mpi: use mpi attribute consistently as the default MPI implementations

Use the attribute mpi to provide a system wide default MPI
implementation. The default is openmpi (as before).
This now allows for overriding the MPI implentation by using
the overlay mechanism. Build all packages with mpich instead
of the default openmpi can now be achived like this:
self: super:
 {
   mpi = super.mpich;
 }

All derivations that have been using "mpi ? null" to provide optional
building with MPI have been change in the following way to allow for
optional builds with MPI:
{ ...
, mpi
, useMpi ? false
}
This commit is contained in:
Markus Kowalewski
2021-01-10 13:40:19 +01:00
parent f6a583eeec
commit 6dba41fbcb
27 changed files with 90 additions and 102 deletions

View File

@@ -3,7 +3,7 @@
, pkgs
, numpy
, scipy
, openmpi
, mpi
, enum34
, protobuf
, pip
@@ -17,8 +17,8 @@ in
buildPythonPackage {
inherit (cntk) name version src;
nativeBuildInputs = [ swig openmpi ];
buildInputs = [ cntk openmpi ];
nativeBuildInputs = [ swig mpi ];
buildInputs = [ cntk mpi ];
propagatedBuildInputs = [ numpy scipy enum34 protobuf pip ];
CNTK_LIB_PATH = "${cntk}/lib";
@@ -28,7 +28,7 @@ buildPythonPackage {
postPatch = ''
cd bindings/python
sed -i 's,"libmpi.so.12","${openmpi}/lib/libmpi.so",g' cntk/train/distributed.py
sed -i 's,"libmpi.so.12","${mpi}/lib/libmpi.so",g' cntk/train/distributed.py
# Remove distro and libs checks; they aren't compatible with NixOS and besides we guarantee
# compatibility by providing a package.