-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for current CI issues with clang14 on MacOS (#1565)
* Use mpirun wrapper to circumvent parser bug in mpirun The bug sounds similar to this one open-mpi/ompi#6372, though that is supposedly fixed in Open MPI 5.. This creates a tmp script to call the launched application instead of calling it directly on the command line. This way, mpirun does not see the command line arguments and cannot try to wrongly parse them. * Add mechanism to get rid of the workaround again in future
- Loading branch information
1 parent
d44f981
commit 6b963ba
Showing
2 changed files
with
53 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,51 @@ | ||
#!/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. | ||
|
||
mpiexec -n 1 ls --all \ | ||
&& echo "MPIRUN WORKING AGAIN, PLEASE REMOVE WORKAROUND" >&2 \ | ||
&& exit 1 \ | ||
|| true | ||
|
||
mpirun_args=() | ||
|
||
script_file="$(mktemp)" | ||
|
||
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" |