How to build parallel hdf5 with nvhpc?

Dear experts,
I want to use cuda-aware MPI and parallel HDF5 together.
How could I build the Parallel HDF5 with nvhpc (nvfortran) to make it work?
Could you please give some guidance? My system is Ubuntu 18.04.5.
I tried a lot. Now I only installed serial HDF5 successfully with gfortran. I can’t install successfully when using nvfortran. I also don’t know how to make sure both cuda-aware MPI and parallel hdf5 to work, which is my final goal.
Thank you very much!
Chen

Hello,

Fellow non-expert here. I have been getting pretty close with the following configuration:

./configure --enable-shared --enable-unsupported --enable-fortran --enable-cxx --disable-hl --enable-tests --enable-tools --enable-threadsafe --enable-profiling --enable-optimization=high --enable-using-memchecker --enable-memory-alloc-sanity-check --enable-parallel --enable-map-api --enable-direct-vfd --enable-hl=False --with-zlib=/path/to/zlib --with-szlib=/path/to/szip

You will need to build zlib and szip using nvhpc and have the environment variables for a cuda aware openmpi (comes with nvhpc)

This currently does not allow for quad precision. I don’t really know how to enable that part. There is software emulation of quad precision that comes with compiler extras in nvhpc. I’d be interested to know if you figure out how to enable it in hdf5.

I forgot to add some things before the configure command, but the best guide i’ve found so far is here:

Just replace all pgi stuff with nvhpc.

This was fairly easy with the NCHPC SDK installed. load NVHPC module which ships with OpenMPI, tell CMake to use the MPI compiler wrappers, enable HDF5 parallel, cmake, make, make install.

$ tar xzfv ~/Downloads/hdf5-1.14.1-2.tar.gz
$ cd hdf5-1.14.1-2/
$ mkdir build
$ cd build
$ module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.3
$ cmake -DCMAKE_C_COMPILER=`which mpicc` -DHDF5_BUILD_FORTRAN=ON -DCMAKE_INSTALL_PREFIX=/work/SENSEI/hdf5-1.14.1-2-install -DHDF5_ENABLE_PARALLEL=ON ..
$ make -j8 install

all seems to be working for me after this.

1 Like

I’ve gotten it to compile, but the tests fail when appending chunks due to a file accessibility error. Do you have that issue?

I was able to build it by passing mpi libs path like following

cmake -DCMAKE_C_COMPILER=which mpicc -DHDF5_BUILD_FORTRAN=ON -DHDF5_ENABLE_PARALLEL=ON BUILD_TESTING=OFF DCMAKE_Fortran_MODULE_DIRECTORY=/opt/nvidia/hpc_sdk/Linux_aarch64/24.11/comm_libs/12.6/openmpi4/openmpi-4.1.5/lib/ ..