summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/mvapich2/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/mvapich2/package.py')
-rw-r--r--var/spack/repos/builtin/packages/mvapich2/package.py170
1 files changed, 89 insertions, 81 deletions
diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py
index 4454907b74..44b064d256 100644
--- a/var/spack/repos/builtin/packages/mvapich2/package.py
+++ b/var/spack/repos/builtin/packages/mvapich2/package.py
@@ -1,27 +1,8 @@
-##############################################################################
-# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
-# Produced at the Lawrence Livermore National Laboratory.
+# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
-# This file is part of Spack.
-# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
-# LLNL-CODE-647188
-#
-# For details, see https://github.com/spack/spack
-# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License (as
-# published by the Free Software Foundation) version 2.1, February 1999.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
-# conditions of the GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##############################################################################
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
import sys
from spack import *
@@ -41,20 +22,18 @@ class Mvapich2(AutotoolsPackage):
url = "http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.2.tar.gz"
list_url = "http://mvapich.cse.ohio-state.edu/downloads/"
- # Newer alpha release
+ version('2.3rc2', '6fcf22fe2a16023b462ef57614daa357')
+ version('2.3rc1', '386d79ae36b2136d203826465ad8b6cc')
version('2.3a', '87c3fbf8a755b53806fa9ecb21453445')
# Prefer the latest stable release
- version('2.2', '939b65ebe5b89a5bc822cdab0f31f96e', preferred=True)
+ version('2.3', sha256='01d5fb592454ddd9ecc17e91c8983b6aea0e7559aa38f410b111c8ef385b50dd', preferred=True)
+ version('2.2', '939b65ebe5b89a5bc822cdab0f31f96e')
version('2.1', '0095ceecb19bbb7fb262131cb9c2cdd6')
version('2.0', '9fbb68a4111a8b6338e476dc657388b4')
- version('1.9', '5dc58ed08fd3142c260b70fe297e127c')
-
- patch('ad_lustre_rwcontig_open_source.patch', when='@1.9')
provides('mpi')
- provides('mpi@:2.2', when='@1.9') # MVAPICH2-1.9 supports MPI 2.2
- provides('mpi@:3.0', when='@2.0:') # MVAPICH2-2.0 supports MPI 3.0
+ provides('mpi@:3.0')
variant('debug', default=False,
description='Enable debug info and error messages at run-time')
@@ -62,6 +41,9 @@ class Mvapich2(AutotoolsPackage):
variant('cuda', default=False,
description='Enable CUDA extension')
+ variant('regcache', default=True,
+ description='Enable memory registration cache')
+
# Accepted values are:
# single - No threads (MPI_THREAD_SINGLE)
# funneled - Only the main thread calls MPI (MPI_THREAD_FUNNELED)
@@ -103,16 +85,44 @@ class Mvapich2(AutotoolsPackage):
)
)
+ variant(
+ 'alloca',
+ default=False,
+ description='Use alloca to allocate temporary memory if available'
+ )
+
+ variant(
+ 'file_systems',
+ description='List of the ROMIO file systems to activate',
+ values=('lustre', 'gpfs', 'nfs', 'ufs'),
+ multi=True
+ )
+
+ depends_on('findutils', type='build')
depends_on('bison', type='build')
depends_on('libpciaccess', when=(sys.platform != 'darwin'))
depends_on('cuda', when='+cuda')
+ depends_on('psm', when='fabrics=psm')
+ depends_on('rdma-core', when='fabrics=mrail')
+ depends_on('rdma-core', when='fabrics=nemesisib')
+ depends_on('rdma-core', when='fabrics=nemesistcpib')
+ depends_on('rdma-core', when='fabrics=nemesisibtcp')
+
+ filter_compiler_wrappers(
+ 'mpicc', 'mpicxx', 'mpif77', 'mpif90', 'mpifort', relative_root='bin'
+ )
- def url_for_version(self, version):
- base_url = "http://mvapich.cse.ohio-state.edu/download"
- if version < Version('2.0'):
- return "%s/mvapich2/mv2/mvapich2-%s.tar.gz" % (base_url, version)
- else:
- return "%s/mvapich/mv2/mvapich2-%s.tar.gz" % (base_url, version)
+ @property
+ def libs(self):
+ query_parameters = self.spec.last_query.extra_parameters
+ libraries = ['libmpi']
+
+ if 'cxx' in query_parameters:
+ libraries = ['libmpicxx'] + libraries
+
+ return find_libraries(
+ libraries, root=self.prefix, shared=True, recursive=True
+ )
@property
def process_manager_options(self):
@@ -122,20 +132,17 @@ class Mvapich2(AutotoolsPackage):
for x in ('hydra', 'gforker', 'remshell'):
if 'process_managers={0}'.format(x) in spec:
other_pms.append(x)
- opts = ['--with-pm=%s' % ':'.join(other_pms)]
+
+ opts = []
+ if len(other_pms) > 0:
+ opts = ['--with-pm=%s' % ':'.join(other_pms)]
# See: http://slurm.schedmd.com/mpi_guide.html#mvapich2
if 'process_managers=slurm' in spec:
- if self.version > Version('2.0'):
- opts = [
- '--with-pmi=pmi2',
- '--with-pm=slurm'
- ]
- else:
- opts = [
- '--with-pmi=slurm',
- '--with-pm=no'
- ]
+ opts = [
+ '--with-pmi=pmi2',
+ '--with-pm=slurm'
+ ]
return opts
@@ -144,7 +151,10 @@ class Mvapich2(AutotoolsPackage):
opts = []
# From here on I can suppose that only one variant has been selected
if 'fabrics=psm' in self.spec:
- opts = ["--with-device=ch3:psm"]
+ opts = [
+ "--with-device=ch3:psm",
+ "--with-psm={0}".format(self.spec['psm'].prefix)
+ ]
elif 'fabrics=sock' in self.spec:
opts = ["--with-device=ch3:sock"]
elif 'fabrics=nemesistcpib' in self.spec:
@@ -156,12 +166,31 @@ class Mvapich2(AutotoolsPackage):
elif 'fabrics=nemesis' in self.spec:
opts = ["--with-device=ch3:nemesis"]
elif 'fabrics=mrail' in self.spec:
- opts = ["--with-device=ch3:mrail", "--with-rdma=gen2"]
+ opts = ["--with-device=ch3:mrail", "--with-rdma=gen2",
+ "--disable-mcast"]
+ return opts
+
+ @property
+ def file_system_options(self):
+ spec = self.spec
+
+ fs = []
+ for x in ('lustre', 'gpfs', 'nfs', 'ufs'):
+ if 'file_systems={0}'.format(x) in spec:
+ fs.append(x)
+
+ opts = []
+ if len(fs) > 0:
+ opts.append('--with-file-system=%s' % '+'.join(fs))
+
return opts
def setup_environment(self, spack_env, run_env):
spec = self.spec
- if 'process_managers=slurm' in spec and spec.satisfies('@2.0:'):
+ # mvapich2 configure fails when F90 and F90FLAGS are set
+ spack_env.unset('F90')
+ spack_env.unset('F90FLAGS')
+ if 'process_managers=slurm' in spec:
run_env.set('SLURM_MPI_TYPE', 'pmi2')
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
@@ -201,13 +230,16 @@ class Mvapich2(AutotoolsPackage):
args = [
'--enable-shared',
'--enable-romio',
- '-disable-silent-rules',
+ '--disable-silent-rules',
+ '--disable-new-dtags',
'--enable-fortran=all',
"--enable-threads={0}".format(spec.variants['threads'].value),
"--with-ch3-rank-bits={0}".format(
spec.variants['ch3_rank_bits'].value),
]
+ args.extend(self.enable_or_disable('alloca'))
+
if '+debug' in self.spec:
args.extend([
'--disable-fast',
@@ -228,36 +260,12 @@ class Mvapich2(AutotoolsPackage):
else:
args.append('--disable-cuda')
+ if '+regcache' in self.spec:
+ args.append('--enable-registration-cache')
+ else:
+ args.append('--disable-registration-cache')
+
args.extend(self.process_manager_options)
args.extend(self.network_options)
+ args.extend(self.file_system_options)
return args
-
- @run_after('install')
- def filter_compilers(self):
- """Run after install to make the MPI compilers use the
- compilers that Spack built the package with.
-
- If this isn't done, they'll have CC, CXX, F77, and FC set
- to Spack's generic cc, c++, f77, and f90. We want them to
- be bound to whatever compiler they were built with.
- """
- bin = self.prefix.bin
- mpicc = join_path(bin, 'mpicc')
- mpicxx = join_path(bin, 'mpicxx')
- mpif77 = join_path(bin, 'mpif77')
- mpif90 = join_path(bin, 'mpif90')
- mpifort = join_path(bin, 'mpifort')
-
- # Substitute Spack compile wrappers for the real
- # underlying compiler
- kwargs = {'ignore_absent': True, 'backup': False, 'string': True}
- filter_file(env['CC'], self.compiler.cc, mpicc, **kwargs)
- filter_file(env['CXX'], self.compiler.cxx, mpicxx, **kwargs)
- filter_file(env['F77'], self.compiler.f77, mpif77, **kwargs)
- filter_file(env['FC'], self.compiler.fc, mpif90, **kwargs)
- filter_file(env['FC'], self.compiler.fc, mpifort, **kwargs)
-
- # Remove this linking flag if present
- # (it turns RPATH into RUNPATH)
- for wrapper in (mpicc, mpicxx, mpif77, mpif90, mpifort):
- filter_file('-Wl,--enable-new-dtags', '', wrapper, **kwargs)