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
This commit is contained in:
Massimiliano Culpo 2018-03-28 10:13:56 +02:00 committed by GitHub
parent 388bb2ab3e
commit 8e998247a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,6 +201,17 @@ class Openmpi(AutotoolsPackage):
variant('cuda', default=False, description='Enable CUDA support') variant('cuda', default=False, description='Enable CUDA support')
variant('ucx', default=False, description='Enable UCX support') variant('ucx', default=False, description='Enable UCX support')
variant('pmi', default=False, description='Enable PMI 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')
provides('mpi@:2.2', when='@1.6.5') provides('mpi@:2.2', when='@1.6.5')
@ -218,6 +229,8 @@ class Openmpi(AutotoolsPackage):
depends_on('java', when='+java') depends_on('java', when='+java')
depends_on('sqlite', when='+sqlite3@:1.11') depends_on('sqlite', when='+sqlite3@:1.11')
depends_on('ucx', when='+ucx') 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('+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 conflicts('fabrics=psm2', when='@:1.8') # PSM2 support was added in 1.10.0
@ -320,6 +333,9 @@ def configure_args(self):
# for Open-MPI 2.0:, C++ bindings are disabled by default. # for Open-MPI 2.0:, C++ bindings are disabled by default.
config_args.extend(['--enable-mpi-cxx']) 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 # Fabrics
config_args.extend(self.with_or_without('fabrics')) config_args.extend(self.with_or_without('fabrics'))
# Schedulers # Schedulers
@ -327,6 +343,13 @@ def configure_args(self):
# PMI # PMI
config_args.extend(self.with_or_without('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 # Hwloc support
if spec.satisfies('@1.5.2:'): if spec.satisfies('@1.5.2:'):
config_args.append('--with-hwloc={0}'.format(spec['hwloc'].prefix)) config_args.append('--with-hwloc={0}'.format(spec['hwloc'].prefix))
@ -398,3 +421,18 @@ def configure_args(self):
config_args.append('--without-ucx') config_args.append('--without-ucx')
return config_args 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)