-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add mpiCheckPhaseHook #246867
add mpiCheckPhaseHook #246867
Conversation
88326c2
to
77f1e58
Compare
Did most of a rebuild on macos 10.15, didn't spot any new failures.. |
pkgs/build-support/setup-hooks/mpi-check-hook/mpi-check-hook.sh
Outdated
Show resolved
Hide resolved
# OpenMPI signature | ||
if command ompi_info &> /dev/null; then | ||
mpiType="openmpi" | ||
fi | ||
|
||
# MPICH based implementations | ||
if command mpichversion &> /dev/null; then | ||
version=$(mpichversion) | ||
if [[ "$version" == *"MPICH"* ]]; then | ||
mpiType="MPICH" | ||
fi | ||
if [[ "$version" == *"MVAPICH"* ]]; then | ||
mpiType="MVAPICH" | ||
fi | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the unlikely event of two MPI implementations being present, this will be ambiguous. Maybe add a warning or error for such a case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the build sandbox this is rather unlikely, but it could happen in a nix-shell.
77f1e58
to
3cf7b21
Compare
Add this hook to checkPhase to allow for running MPI application in the sandbox. It detects the MPI implementations and sets the respective environment variables.
3cf7b21
to
cfc44b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of changes
MPI programs usually expect some kind of bare metal machine to run its tasks. Packages that run a test (i.e. in the checkPhase) have to do so in the sandbox.
The new hook sets variables to allow it for running in smoothly in a sandbox.
It avoids the boiler plate of setting these variables for each package.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)