envelope-project / laik

Other
9 stars 8 forks source link

Allow specifying the MPI implementation when building with CMake #156

Closed AlexanderKurtz closed 6 years ago

AlexanderKurtz commented 6 years ago

This PR makes the following possible:

Building with OpenMPI

$ cd build-ompi/
$ cmake -D mpi-implementation=ompi ..
[...]
$ make
[...]
$ ctest
[...]
$ ldd examples/vsum | grep libmpi
    libmpi.so.40 => /usr/lib/x86_64-linux-gnu/libmpi.so.40 (0x00007f8ea9367000)
$ 

Building with MPICH

$ cd build-mpich/
$ cmake -D mpi-implementation=mpich ..
[...]
$ make
[...]
$ ctest
[...]
$ ldd examples/vsum | grep libmpi
    libmpich.so.0 => /usr/lib/x86_64-linux-gnu/libmpich.so.0 (0x00007fd8c485d000)
$ 

Furthermore, this PR also addresses #155 by passing the --oversubscribe option when OpenMPI is requested explicitly.

weidendo commented 6 years ago

Hmm.. I already tested with MPICH without problems. On Debian/Ubuntu, you can just switch via "update-alternatives", and it works out-of-the-box now. I just checked your link: MPI does not mandate "mpiexec" to exist at all, it is just "recommended" - IBM MPI has "doe". So this PR does not really make it more "MPI compliant".

However, I like the flexibility of providing a variable for the MPI spawn command in the tests.