From f8dc3853922ee74938c0ee15cd40bc0290b558fa Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 20 Apr 2019 17:03:18 -0500 Subject: [PATCH] Mercury package: add version 1.0.1 and update dependencies (#10906) * Add Mercury version 1.0.1 * Remove cci and bmi dependency requirements: these are not currently defined in Spack. If +bmi is enabled, the effect is that it may use a system install of bmi * Add a note that fabtests is deprecated and has been folded into the libfabric package. Add the fabtests resource to the libfabric package * Add CMake option settings to Mercury based on variant settings * Mercury: Set OFI testing protocol depending on how libfabric was built * Mercury: add version constraints to dependencies --- .../builtin/packages/fabtests/package.py | 7 +- .../builtin/packages/libfabric/package.py | 56 +++++++++- .../repos/builtin/packages/mercury/package.py | 105 +++++++++++++----- 3 files changed, 136 insertions(+), 32 deletions(-) diff --git a/var/spack/repos/builtin/packages/fabtests/package.py b/var/spack/repos/builtin/packages/fabtests/package.py index 0ed147cae9..6ad9acad9a 100644 --- a/var/spack/repos/builtin/packages/fabtests/package.py +++ b/var/spack/repos/builtin/packages/fabtests/package.py @@ -7,7 +7,9 @@ class Fabtests(AutotoolsPackage): - """Fabtests provides a set of examples that uses libfabric""" + """Fabtests provides a set of examples that uses libfabric. + + DEPRECATED. Fabtests has merged with the libfabric git repo.""" homepage = "http://libfabric.org" url = "https://github.com/ofiwg/fabtests/releases/download/v1.5.3/fabtests-1.5.3.tar.gz" @@ -15,4 +17,5 @@ class Fabtests(AutotoolsPackage): version('1.6.0', '0441aa0aeda391b1bf1eb71250a4afbc') version('1.5.3', 'f60cb95843ebf62e4eaa128e08ccdc7d') - depends_on('libfabric') + depends_on('libfabric@1.6.0', when='@1.6.0') + depends_on('libfabric@1.5.3', when='@1.5.3') diff --git a/var/spack/repos/builtin/packages/libfabric/package.py b/var/spack/repos/builtin/packages/libfabric/package.py index f71588250a..e318a95169 100644 --- a/var/spack/repos/builtin/packages/libfabric/package.py +++ b/var/spack/repos/builtin/packages/libfabric/package.py @@ -12,7 +12,7 @@ class Libfabric(AutotoolsPackage): homepage = "https://libfabric.org/" url = "https://github.com/ofiwg/libfabric/releases/download/v1.6.1/libfabric-1.6.1.tar.gz" - git = "https://github.com/ofiwg/libfabric.git" + git = "https://github.com/ofiwg/libfabric.git" version('develop', branch='master') version('1.7.1', sha256='312e62c57f79b7274f89c41823932c00b15f1cc8de9c1f8dce17cd7fdae66fa1') @@ -54,16 +54,64 @@ class Libfabric(AutotoolsPackage): depends_on('automake', when='@develop', type='build') depends_on('libtool', when='@develop', type='build') + resource(name='fabtests', + url='https://github.com/ofiwg/libfabric/releases/download/v1.7.0/fabtests-1.7.0.tar.gz', + sha256='ebb4129dc69dc0e1f48310ce1abb96673d8ddb18166bc595312ebcb96e803de9', + placement='fabtests', when='@1.7.0') + resource(name='fabtests', + url='https://github.com/ofiwg/fabtests/releases/download/v1.6.1/fabtests-1.6.1.tar.gz', + sha256='d357466b868fdaf1560d89ffac4c4e93a679486f1b4221315644d8d3e21174bf', + placement='fabtests', when='@1.6.1') + resource(name='fabtests', + url='https://github.com/ofiwg/fabtests/releases/download/v1.6.0/fabtests-1.6.0.tar.gz', + sha256='dc3eeccccb005205017f5af60681ede15782ce202a0103450a6d56a7ff515a67', + placement='fabtests', when='@1.6.0') + resource(name='fabtests', + url='https://github.com/ofiwg/fabtests/releases/download/v1.5.3/fabtests-1.5.3.tar.gz', + sha256='3835b3bf86cd00d23df0ddba8bf317e4a195e8d5c3c2baa918b373d548f77f29', + placement='fabtests', when='@1.5.3') + resource(name='fabtests', + url='https://github.com/ofiwg/fabtests/releases/download/v1.5.0/fabtests-1.5.0.tar.gz', + sha256='1dddd446c3f1df346899f9a8636f1b4265de5b863103ae24876e9f0c1e40a69d', + placement='fabtests', when='@1.5.0') + resource(name='fabtests', + url='https://github.com/ofiwg/fabtests/releases/download/v1.4.2/fabtests-1.4.2.tar.gz', + sha256='3b78d0ca1b223ff21b7f5b3627e67e358e3c18b700f86b017e2233fee7e88c2e', + placement='fabtests', when='@1.5.0') + + def setup_environment(self, spack_env, run_env): + if self.run_tests: + spack_env.prepend_path('PATH', self.prefix.bin) + @when('@develop') def autoreconf(self, spec, prefix): bash = which('bash') bash('./autogen.sh') + if self.run_tests: + with working_dir('fabtests'): + bash('./autogen.sh') + def configure_args(self): args = [] - args.extend(['--enable-%s=%s' % - (f, 'yes' if 'fabrics=%s' % f in self.spec else 'no') - for f in self.fabrics]) + for fabric in self.fabrics: + if 'fabrics=' + fabric in self.spec: + args.append('--enable-{0}=yes'.format(fabric)) + else: + args.append('--enable-{0}=no'.format(fabric)) return args + + def installcheck(self): + fi_info = Executable(self.prefix.bin.fi_info) + fi_info() + + # Build and run more extensive tests + with working_dir('fabtests'): + configure = Executable('./configure') + configure('--prefix={0}'.format(self.prefix), + '--with-libfabric={0}'.format(self.prefix)) + make() + make('install') + make('test') diff --git a/var/spack/repos/builtin/packages/mercury/package.py b/var/spack/repos/builtin/packages/mercury/package.py index 23e8695ee1..bfa45491c9 100644 --- a/var/spack/repos/builtin/packages/mercury/package.py +++ b/var/spack/repos/builtin/packages/mercury/package.py @@ -13,53 +13,106 @@ class Mercury(CMakePackage): git = 'https://github.com/mercury-hpc/mercury.git' version('develop', branch='master', submodules=True) + version('1.0.1', tag='v1.0.1', submodules=True) version('1.0.0', tag='v1.0.0', submodules=True) version('0.9.0', tag='v0.9.0', submodules=True) - variant('cci', default=False, description='Use CCI for network transport') variant('bmi', default=False, description='Use BMI for network transport') - variant('fabric', default=True, description='Use libfabric for network transport') + variant('cci', default=False, description='Use CCI for network transport') + variant('mpi', default=False, description='Use MPI for network transport') + variant('ofi', default=True, description='Use libfabric plugin') + variant('sm', default=False, description='Use shared-memory plugin') + variant('opa', default=False, description='Use OpenPA for atomics') + variant('boost', default=True, description='Use BOOST preprocessor macros') variant('selfforward', default=True, description='Mercury will short-circuit operations' + ' by forwarding to itself when possible') -# NOTE: the 'udreg' variant requires that the MPICH_GNI_NDREG_ENTRIES=1024 -# environment variable be set at run time to avoid conflicts with -# Cray-MPICH if libfabric and MPI are used at the same time + # NOTE: the 'udreg' variant requires that the MPICH_GNI_NDREG_ENTRIES=1024 + # environment variable be set at run time to avoid conflicts with + # Cray-MPICH if libfabric and MPI are used at the same time variant('udreg', default=False, description='Enable udreg on supported Cray platforms') - depends_on('cci@master', when='+cci', type=('build', 'link', 'run')) - depends_on('libfabric', when='+fabric', type=('build', 'link', 'run')) - depends_on('bmi', when='+bmi', type=('build', 'link', 'run')) - depends_on('openpa', type=('build', 'link', 'run')) + depends_on('cmake@2.8.12.2:', type='build') + # depends_on('bmi', when='+bmi') # TODO: add BMI package + # depends_on('cci', when='+cci') # TODO: add CCI package + depends_on('mpi', when='+mpi') + depends_on('libfabric@1.5:', when='+ofi') + depends_on('openpa@1.0.3:', when='+opa') + depends_on('boost@1.48:', when='+boost') def cmake_args(self): - args = ['-DMERCURY_USE_BOOST_PP:BOOL=ON', - '-DBUILD_SHARED_LIBS=ON'] + spec = self.spec + args = [ + '-DBUILD_SHARED_LIBS=ON', + '-DMERCURY_USE_CHECKSUMS=ON', + '-DMERCURY_USE_EAGER_BULK=ON', + '-DMERCURY_USE_SYSTEM_MCHECKSUM=OFF', + '-DMERCURY_USE_XDR=OFF' + ] - if (self.spec.variants['cci'].value): - args.extend(['-DNA_USE_CCI:BOOL=ON']) + if '+boost' in spec: + args.append('-DMERCURY_USE_BOOST_PP=ON') else: - args.extend(['-DNA_USE_CCI:BOOL=OFF']) + args.append('-DMERCURY_USE_BOOST_PP=OFF') - if (self.spec.variants['bmi'].value): - args.extend(['-DNA_USE_BMI:BOOL=ON']) + if '+bmi' in spec: + args.append('-DNA_USE_BMI=ON') else: - args.extend(['-DNA_USE_BMI:BOOL=OFF']) + args.append('-DNA_USE_BMI=OFF') - if (self.spec.variants['fabric'].value): - args.extend(['-DNA_USE_OFI:BOOL=ON']) + if '+cci' in spec: + args.append('-DNA_USE_CCI=ON') else: - args.extend(['-DNA_USE_OFI:BOOL=OFF']) + args.append('-DNA_USE_CCI=OFF') - if (self.spec.variants['selfforward'].value): - args.extend(['-DMERCURY_USE_SELF_FORWARD=ON']) + if '+mpi' in spec: + args.append('-DNA_USE_MPI=ON') else: - args.extend(['-DMERCURY_USE_SELF_FORWARD=OFF']) + args.append('-DNA_USE_MPI=OFF') - if (self.spec.variants['udreg'].value): - args.extend(['-DNA_OFI_GNI_USE_UDREG=ON']) + if '+ofi' in spec: + args.append('-DNA_USE_OFI=ON') + if self.run_tests: + args.append('-DNA_OFI_TESTING_PROTOCOL={0}'.format(';'.join( + spec['libfabric'].variants['fabrics'].value))) else: - args.extend(['-DNA_OFI_GNI_USE_UDREG=OFF']) + args.append('-DNA_USE_OFI=OFF') + + if '+sm' in spec: + args.append('-DNA_USE_SM=ON') + else: + args.append('-DNA_USE_SM=OFF') + + if '+opa' in spec: + args.append('-DMERCURY_USE_OPA=ON') + else: + args.append('-DMERCURY_USE_OPA=OFF') + + if '+selfforward' in spec: + args.append('-DMERCURY_USE_SELF_FORWARD=ON') + else: + args.append('-DMERCURY_USE_SELF_FORWARD=OFF') + + if '+udreg' in spec: + args.append('-DNA_OFI_GNI_USE_UDREG=ON') + else: + args.append('-DNA_OFI_GNI_USE_UDREG=OFF') + + if self.run_tests: + args.append('-DBUILD_TESTING=ON') + else: + args.append('-DBUILD_TESTING=OFF') + + if '+mpi' in spec and self.run_tests: + args.append('-DMERCURY_ENABLE_PARALLEL_TESTING=ON') + else: + args.append('-DMERCURY_ENABLE_PARALLEL_TESTING=OFF') return args + + def check(self): + """Unit tests fail when run in parallel.""" + + with working_dir(self.build_directory): + make('test', parallel=False)