Skip to content

Commit

Permalink
Try working around current CI issues with clang14 on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Dec 5, 2023
1 parent 72ab3d1 commit dfe5d61
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
-DopenPMD_USE_MPI=ON \
-DopenPMD_USE_HDF5=ON \
-DopenPMD_USE_ADIOS2=ON \
-DopenPMD_USE_INVASIVE_TESTS=ON
-DopenPMD_USE_INVASIVE_TESTS=ON \
-DMPIEXEC_EXECUTABLE=./.github/workflows/mpirun_workaround.sh
cmake --build build --parallel 3
ctest --test-dir build --verbose
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/mpirun_workaround.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

# mpiexec currently seems to have a bug where it tries to parse parameters
# of the launched application when they start with a dash, e.g.
# `mpiexec python ./openpmd-pipe --infile in.bp --outfile out.bp`
# leads to:
# > An unrecognized option was included on the mpiexec command line:
# >
# > Option: --infile
# >
# > Please use the "mpiexec --help" command to obtain a list of all
# > supported options.
#
# This script provides a workaround by putting the called sub-command into
# a script in a temporary file.

mpirun_args=()

script_file="$(mktemp -p .)"

cleanup() {
rm "$script_file"
}
trap cleanup EXIT

while true; do
case "$1" in
-c | -np | --np | -n | --n )
mpirun_args+=("$1" "$2")
shift
shift
;;
*)
break
;;
esac
done

echo -e '#!/usr/bin/env bash\n' > "$script_file"
for item in "$@"; do
echo -n "'$item' " >> "$script_file"
done

chmod +x "$script_file"

mpirun "${mpirun_args[@]}" "$script_file"

0 comments on commit dfe5d61

Please sign in to comment.