diff --git a/.github/workflows/spack-mac.yml b/.github/workflows/spack-mac.yml index 9308446..7b2b6aa 100644 --- a/.github/workflows/spack-mac.yml +++ b/.github/workflows/spack-mac.yml @@ -23,5 +23,4 @@ jobs: . ./spack/share/spack/setup-env.sh spack repo add . spack repo list - spack install hdf5-cmake - spack install hdf5-hpc-io + spack install hdf5-vol-tests+vol-cache diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 73cbdd1..2a5375e 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -21,9 +21,10 @@ jobs: - name: Run a multi-line script run: | + sudo apt-get update -y + sudo apt-get install -y libopenmpi-dev . ./spack/share/spack/setup-env.sh spack repo add . spack repo list - spack install hdf5-cmake - spack install hdf5-hpc-io + spack install hdf5-vol-async diff --git a/.github/workflows/vfd-gds.yml b/.github/workflows/vfd-gds.yml new file mode 100644 index 0000000..c98b3c2 --- /dev/null +++ b/.github/workflows/vfd-gds.yml @@ -0,0 +1,42 @@ +name: VFD GDS + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get -y update + sudo apt-get -y install ninja-build automake autoconf cmake libtool libtool-bin libopenmpi-dev libpthread-stubs0-dev + - name: Install GDS/CUDA + run: | + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin + sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 + sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub + sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" + sudo apt-get -y update + sudo apt-get -y install cuda + - name: Checkout hdf-spack + uses: actions/checkout@v2 + - name: Checkout spack + uses: actions/checkout@v2 + with: + repository: spack/spack + path: ./spack + - name: Run a multi-line script + run: | + set + export PATH="/usr/local/cuda-11.5/bin:$PATH" + set + . ./spack/share/spack/setup-env.sh + spack repo add . + spack repo list + spack external find cuda + spack install hdf5-vfd-gds@master ^openmpi@4.0.3 ^cmake@3.16.3 diff --git a/packages/hdf5-vfd-gds/package.py b/packages/hdf5-vfd-gds/package.py new file mode 100644 index 0000000..977ada1 --- /dev/null +++ b/packages/hdf5-vfd-gds/package.py @@ -0,0 +1,36 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + +class Hdf5VfdGds(CMakePackage, CudaPackage): + """This pacakge enables GPU Direct Storage Virtual File Driver in HDF5.""" + + # Package info + homepage = 'https://github.com/hpc-io/vfd-gds' + url = 'https://github.com/hpc-io/vfd-gds/archive/refs/tags/1.0.1.tar.gz' + git = 'https://github.com/hpc-io/vfd-gds.git' + maintainers = ['hyoklee', 'lrknox'] + + # Versions + version('master', branch='master') + version('1.0.1', sha256='00e125fd149561be991f41e883824de826d8add604aebccf103a4fb82d5faac2', default=True) + version('1.0.0', sha256='6b16105c7c49f13fc05784ee69b78d45fb159270c78d760689f9cd21e230ddd2') + + # Dependencies + depends_on('cuda') + depends_on('cmake@3.12:') + depends_on('hdf5@1.13.0:') + + + def cmake_args(self): + spec = self.spec + + # CMake options + args = [ + self.define('BUILD_TESTING', self.run_tests), + ] + + return args diff --git a/packages/hdf5-vol-async/package.py b/packages/hdf5-vol-async/package.py index c41a353..a0a12a1 100644 --- a/packages/hdf5-vol-async/package.py +++ b/packages/hdf5-vol-async/package.py @@ -9,16 +9,20 @@ class Hdf5VolAsync(CMakePackage): """This package enables asynchronous IO in HDF5.""" homepage = "https://sdm.lbl.gov/" - # hpc-io hasn't accepted the pull request for CMakeLists.txt yet. - # git = "https://github.com/hpc-io/vol-async" - git = "https://github.com/hyoklee/vol-async" + git = "https://github.com/hpc-io/vol-async" maintainers = ['hyoklee'] - version('develop', branch='develop') + version('develop', branch='develop', preferred=True) + version('hyoklee.develop', + branch='develop', + git='https://github.com/hyoklee/vol-async') + version('local.develop', branch='develop', + git='file:///scr/hyoklee/src/vol-async') depends_on('argobots@main') - # depends_on('hdf5-hpc-io') - depends_on('hdf5-cmake') + depends_on('hdf5-hpc-io') + # Use the following if you want to use HDFGroup/hdf5@develop-1.3 instead. + # depends_on('hdf5@develop-1.13+mpi+threadsafe') def cmake_args(self): """Populate cmake arguments for HDF5 VOL.""" @@ -27,6 +31,16 @@ def cmake_args(self): args = [ '-DBUILD_SHARED_LIBS:BOOL=ON', '-DBUILD_TESTING:BOOL=ON' + '-DCMAKE_C_COMPILER=mpicc', + '-DCMAKE_CXX_COMPILER=mpicxx', ] return args + + + def setup_environment(self, spack_env, run_env): + spack_env.set('HDF5_PLUGIN_PATH', self.build_directory+'/lib') + spack_env.set('HDF5_VOL_CONNECTOR', + 'async under_vol=0\;under_info={}') + spack_env.set('LD_PRELOAD', self.spec['argobots'].prefix+'/lib/libabt.so') + diff --git a/packages/hdf5-vol-cache/package.py b/packages/hdf5-vol-cache/package.py index 572dd06..30cd44a 100644 --- a/packages/hdf5-vol-cache/package.py +++ b/packages/hdf5-vol-cache/package.py @@ -14,12 +14,10 @@ class Hdf5VolCache(CMakePackage): maintainers = ['hyoklee'] version('default', branch='develop') - - # Set hdf5-cmake package option. - o_flt = '~zfp~mafisc~szip~zstd~blosc~bshuf~bitgroom' - o_vol = '~av~pv~cv' - o_par = '+mpi+threadsafe' - o = o_flt+o_vol+o_par + version('hyoklee.develop', branch='develop', + git='https://github.com/hyoklee/vol-cache.git', preferred=True) + version('local.develop', branch='develop', + git='file:///home/hyoklee/vol-cache') depends_on('hdf5-vol-async') diff --git a/packages/hdf5-vol-external-passthrough/package.py b/packages/hdf5-vol-external-passthrough/package.py index 664b85d..d02276a 100644 --- a/packages/hdf5-vol-external-passthrough/package.py +++ b/packages/hdf5-vol-external-passthrough/package.py @@ -20,8 +20,6 @@ class Hdf5VolExternalPassthrough(CMakePackage): def cmake_args(self): """Populate cmake arguments for HDF5 DAOS.""" - spec = self.spec - args = [ '-DBUILD_SHARED_LIBS:BOOL=ON', '-DBUILD_TESTING:BOOL=ON' diff --git a/packages/hdf5-vol-tests/package.py b/packages/hdf5-vol-tests/package.py index 9b25109..26c7ce5 100644 --- a/packages/hdf5-vol-tests/package.py +++ b/packages/hdf5-vol-tests/package.py @@ -14,21 +14,34 @@ class Hdf5VolTests(CMakePackage): maintainers = ['hyoklee'] - version('master', preferred=True) - variant('vol-async', default=True, description='Enable async VOL') + version('master', commit='9a147d3') + version('hyoklee.master', + git='https://github.com/hyoklee/vol-tests', preferred=True) + version('local.master', + git='file:///Users/hyoklee/src/vol-tests') + variant('vol-async', default=False, description='Enable async VOL') variant('vol-cache', default=False, description='Enable cache VOL') variant('vol-external-passthrough', default=False, description='Enable external pass-through VOL') - - variant('async', default=True, description='Enable parallel tests.') - variant('parallel', default=True, description='Enable async API tests.') + variant('vol-log', default=False, + description='Enable log-based VOL') + variant('vol-adios2', default=False, + description='Enable ADIOS2 VOL') + variant('vol-rest', default=False, + description='Enable REST VOL') + + variant('async', default=True, description='Enable async API tests.') + variant('parallel', default=True, description='Enable parallel tests.') variant('part', default=True, description='Enable building the main test executable.') - depends_on('szip', when='+parallel') + depends_on('szip') depends_on('hdf5-vol-async', when='+vol-async') depends_on('hdf5-vol-cache', when='+vol-cache') depends_on('hdf5-vol-external-passthrough', when='+vol-external-passthrough') + depends_on('hdf5-vol-log', when='+vol-log') + depends_on('adios2+shared+hdf5 ^hdf5@1.12.1', when='+vol-adios2') + depends_on('hdf5-vol-rest', when='+vol-rest') def cmake_args(self): args = [] diff --git a/packages/hdf5/h5f90global-mult-obj-same-equivalence-same-common-block.patch b/packages/hdf5/h5f90global-mult-obj-same-equivalence-same-common-block.patch index 5d0f653..8bf5c14 100644 --- a/packages/hdf5/h5f90global-mult-obj-same-equivalence-same-common-block.patch +++ b/packages/hdf5/h5f90global-mult-obj-same-equivalence-same-common-block.patch @@ -14,4 +14,3 @@ index dd2b171..629418a 100644 EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) - diff --git a/packages/hdf5/h5public-skip-mpicxx.patch b/packages/hdf5/h5public-skip-mpicxx.patch index c72b819..d609345 100644 --- a/packages/hdf5/h5public-skip-mpicxx.patch +++ b/packages/hdf5/h5public-skip-mpicxx.patch @@ -9,4 +9,3 @@ # include #ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ # include - diff --git a/packages/hdf5/package.py b/packages/hdf5/package.py index f110700..26db199 100644 --- a/packages/hdf5/package.py +++ b/packages/hdf5/package.py @@ -24,6 +24,8 @@ class Hdf5(CMakePackage): maintainers = ['lrknox', 'brtnfld', 'byrnHDF', 'ChristopherHogan', 'epourmal', 'gheber', 'hyoklee', 'lkurz', 'soumagne'] + tags = ['e4s'] + test_requires_compiler = True # The 'develop' version is renamed so that we could uninstall (or patch) it @@ -91,13 +93,13 @@ class Hdf5(CMakePackage): # The compiler wrappers (h5cc, h5fc, etc.) run 'pkg-config'. depends_on('pkgconfig', type='run') - conflicts('api=v114', when='@1.6:1.12.99', + conflicts('api=v114', when='@1.6:1.12', msg='v114 is not compatible with this release') - conflicts('api=v112', when='@1.6:1.10.99', + conflicts('api=v112', when='@1.6:1.10', msg='v112 is not compatible with this release') - conflicts('api=v110', when='@1.6:1.8.99', + conflicts('api=v110', when='@1.6:1.8', msg='v110 is not compatible with this release') - conflicts('api=v18', when='@1.6:1.6.99', + conflicts('api=v18', when='@1.6.0:1.6', msg='v18 is not compatible with this release') # The Java wrappers and associated libhdf5_java library @@ -172,6 +174,13 @@ def patch(self): 'INTEGER(SIZE_T), INTENT(OUT) :: buf_size', 'fortran/src/H5Fff_F03.f90', string=True, ignore_absent=True) + if self.run_tests: + # hdf5 has ~2200 CPU-intensive tests, some of them have races: + # Often, these loop endless(at least on one Xeon and one EPYC). + # testphdf5 fails indeterministic. This fixes finishing the tests + filter_file('REMOVE_ITEM H5P_TESTS', + 'REMOVE_ITEM H5P_TESTS t_bigio t_shapesame testphdf5', + 'testpar/CMakeTests.cmake') # The parallel compiler wrappers (i.e. h5pcc, h5pfc, etc.) reference MPI # compiler wrappers and do not need to be changed. @@ -185,26 +194,33 @@ def url_for_version(self, version): return url.format(version.up_to(2), version) def flag_handler(self, name, flags): + spec = self.spec cmake_flags = [] if name == "cflags": - cc_name = os.path.basename(self.compiler.cc) - if "clang" in cc_name or "gcc" in cc_name: + if spec.compiler.name in ['gcc', 'clang', 'apple-clang']: # Quiet warnings/errors about implicit declaration of functions # in C99: cmake_flags.append("-Wno-implicit-function-declaration") - if self.spec.satisfies('@:1.8.12~shared'): + # Note that this flag will cause an error if building %nvhpc. + if spec.satisfies('@:1.8.12~shared'): # More recent versions set CMAKE_POSITION_INDEPENDENT_CODE to # True and build with PIC flags. cmake_flags.append(self.compiler.cc_pic_flag) elif name == 'cxxflags': - if self.spec.satisfies('@:1.8.12+cxx~shared'): + if spec.satisfies('@:1.8.12+cxx~shared'): cmake_flags.append(self.compiler.cxx_pic_flag) elif name == "fflags": - if self.spec.satisfies('@:1.8.12+fortran~shared'): + if spec.satisfies('%cce+fortran'): + # Cray compiler generates module files with uppercase names by + # default, which is not handled by the CMake scripts. The + # following flag forces the compiler to produce module files + # with lowercase names. + cmake_flags.append('-ef') + if spec.satisfies('@:1.8.12+fortran~shared'): cmake_flags.append(self.compiler.fc_pic_flag) elif name == "ldlibs": - if '+fortran %fj' in self.spec: + if '+fortran %fj' in spec: cmake_flags.extend(['-lfj90i', '-lfj90f', '-lfjsrcinfo', '-lelf']) @@ -386,9 +402,9 @@ def ensure_parallel_compiler_wrappers(self): # 1.10.6 and 1.12.0. The current develop versions do not produce 'h5pfc' # at all. Here, we make sure that 'h5pfc' is available when Fortran and # MPI support are enabled (only for versions that generate 'h5fc'). - if self.spec.satisfies('@1.8.22:1.8.999,' - '1.10.6:1.10.999,' - '1.12.0:1.12.999,' + if self.spec.satisfies('@1.8.22:1.8,' + '1.10.6:1.10,' + '1.12.0:1.12,' 'develop:' '+fortran+mpi'): with working_dir(self.prefix.bin): diff --git a/packages/hdf5/pre-c99-comments.patch b/packages/hdf5/pre-c99-comments.patch index 48a9d0d..97743e8 100644 --- a/packages/hdf5/pre-c99-comments.patch +++ b/packages/hdf5/pre-c99-comments.patch @@ -41,4 +41,3 @@ index 9ce3524..3b4e5e7 100644 } /*------------------------------------------------------------------------- -