forked from openPMD/openPMD-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try working around current CI issues with clang14 on MacOS
- Loading branch information
1 parent
72ab3d1
commit ce0a0b8
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |