mpich: Improve package (#10643)

- Add missing pkg-config, libpciaccess and libxml2 dependencies
- Add slurm variant for nodelist parsing
- Add missing configure flag for libfabric
- Unset F90 and F90FLAGS
- Allow selecting different PMI interfaces
This commit is contained in:
Michael Kuhn 2019-02-27 20:13:44 +01:00 committed by Peter Scheibel
parent ab499a958d
commit b1a04b7699

View file

@ -29,9 +29,16 @@ class Mpich(AutotoolsPackage):
version('3.0.4', '9c5d5d4fe1e17dd12153f40bc5b6dbc0')
variant('hydra', default=True, description='Build the hydra process manager')
variant('pmi', default=True, description='Build with PMI support')
variant('romio', default=True, description='Enable ROMIO MPI I/O implementation')
variant('verbs', default=False, description='Build support for OpenFabrics verbs.')
variant('slurm', default=False, description='Enable SLURM support')
variant(
'pmi',
default='pmi',
description='''PMI interface.''',
values=('off', 'pmi', 'pmi2', 'pmix'),
multi=False
)
variant(
'device',
default='ch3',
@ -65,15 +72,31 @@ class Mpich(AutotoolsPackage):
patch('mpich32_clang.patch', when='@3.2:3.2.0%clang')
depends_on('findutils', type='build')
depends_on('pkgconfig', type='build')
depends_on('libfabric', when='netmod=ofi')
depends_on('libpciaccess')
depends_on('libxml2')
# Starting with version 3.3, Hydra can use libslurm for nodelist parsing
depends_on('slurm', when='+slurm')
depends_on('pmix', when='pmi=pmix')
conflicts('device=ch4', when='@:3.2')
conflicts('netmod=ofi', when='@:3.1.4')
conflicts('netmod=ucx', when='device=ch3')
conflicts('netmod=mxm', when='device=ch4')
conflicts('netmod=mxm', when='@:3.1.3')
conflicts('netmod=tcp', when='device=ch4')
conflicts('pmi=pmi2', when='device=ch3 netmod=ofi')
conflicts('pmi=pmix', when='device=ch3')
def setup_environment(self, spack_env, run_env):
# mpich configure fails when F90 and F90FLAGS are set
spack_env.unset('F90')
spack_env.unset('F90FLAGS')
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# On Cray, the regular compiler wrappers *are* the MPI wrappers.
@ -135,11 +158,19 @@ def configure_args(self):
config_args = [
'--enable-shared',
'--with-pm={0}'.format('hydra' if '+hydra' in spec else 'no'),
'--with-pmi={0}'.format('yes' if '+pmi' in spec else 'no'),
'--{0}-romio'.format('enable' if '+romio' in spec else 'disable'),
'--{0}-ibverbs'.format('with' if '+verbs' in spec else 'without')
]
if 'pmi=off' in spec:
config_args.append('--with-pmi=no')
elif 'pmi=pmi' in spec:
config_args.append('--with-pmi=simple')
elif 'pmi=pmi2' in spec:
config_args.append('--with-pmi=pmi2/simple')
elif 'pmi=pmix' in spec:
config_args.append('--with-pmix={0}'.format(spec['pmix'].prefix))
# setup device configuration
device_config = ''
if 'device=ch4' in spec:
@ -158,4 +189,10 @@ def configure_args(self):
config_args.append(device_config)
# Specify libfabric's path explicitly, otherwise configure might fall
# back to an embedded version of libfabric.
if 'netmod=ofi' in spec:
config_args.append('--with-libfabric={0}'.format(
spec['libfabric'].prefix))
return config_args