diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2018-03-28 10:13:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 10:13:56 +0200 |
commit | 8e998247a3ddcc2f623772f4d467c16ac829a688 (patch) | |
tree | 2ef6a230adce1d268f75e686ca34189c45a3c6d2 /var | |
parent | 388bb2ab3ee7f0406822d2c277b0f54b9aa0694f (diff) | |
download | spack-8e998247a3ddcc2f623772f4d467c16ac829a688.tar.gz spack-8e998247a3ddcc2f623772f4d467c16ac829a688.tar.bz2 spack-8e998247a3ddcc2f623772f4d467c16ac829a688.tar.xz spack-8e998247a3ddcc2f623772f4d467c16ac829a688.zip |
openmpi: updated package (#7574)
Modifications:
* Added zlib dependency, starting from version 3.0.0
* Added memchecker support for debugging
* Remove mpirun and similar links if slurm is selected as a scheduler
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/openmpi/package.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 0c6180923f..b019a118a9 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -201,6 +201,17 @@ class Openmpi(AutotoolsPackage): variant('cuda', default=False, description='Enable CUDA support') variant('ucx', default=False, description='Enable UCX support') variant('pmi', default=False, description='Enable PMI support') + # Adding support to build a debug version of OpenMPI that activates + # Memchecker, as described here: + # + # https://www.open-mpi.org/faq/?category=debugging#memchecker_what + # + # This option degrades run-time support, and thus is disabled by default + variant( + 'memchecker', + default=False, + description='Memchecker support for debugging [degrades performance]' + ) provides('mpi') provides('mpi@:2.2', when='@1.6.5') @@ -218,6 +229,8 @@ class Openmpi(AutotoolsPackage): depends_on('java', when='+java') depends_on('sqlite', when='+sqlite3@:1.11') depends_on('ucx', when='+ucx') + depends_on('zlib', when='@3.0.0:') + depends_on('valgrind~mpi', when='+memchecker') conflicts('+cuda', when='@:1.6') # CUDA support was added in 1.7 conflicts('fabrics=psm2', when='@:1.8') # PSM2 support was added in 1.10.0 @@ -320,6 +333,9 @@ class Openmpi(AutotoolsPackage): # for Open-MPI 2.0:, C++ bindings are disabled by default. config_args.extend(['--enable-mpi-cxx']) + if spec.satisfies('@3.0.0:', strict=True): + config_args.append('--with-zlib={0}'.format(spec['zlib'].prefix)) + # Fabrics config_args.extend(self.with_or_without('fabrics')) # Schedulers @@ -327,6 +343,13 @@ class Openmpi(AutotoolsPackage): # PMI config_args.extend(self.with_or_without('pmi')) + config_args.extend(self.enable_or_disable('memchecker')) + if spec.satisfies('+memchecker', strict=True): + config_args.extend([ + '--enable-debug', + '--with-valgrind={0}'.format(spec['valgrind'].prefix), + ]) + # Hwloc support if spec.satisfies('@1.5.2:'): config_args.append('--with-hwloc={0}'.format(spec['hwloc'].prefix)) @@ -398,3 +421,18 @@ class Openmpi(AutotoolsPackage): config_args.append('--without-ucx') return config_args + + @run_after('install') + def delete_mpirun_mpiexec(self): + # The preferred way to run an application when Slurm is the + # scheduler is to let Slurm manage process spawning via PMI. + # + # Deleting the links to orterun avoids users running their + # applications via mpirun or mpiexec, and leaves srun as the + # only sensible choice (orterun is still present, but normal + # users don't know about that). + if '@1.6: schedulers=slurm' in self.spec: + os.remove(self.prefix.bin.mpirun) + os.remove(self.prefix.bin.mpiexec) + os.remove(self.prefix.bin.shmemrun) + os.remove(self.prefix.bin.oshrun) |