For parallel I/O to work, HDF5 must be installed with –enable-parallel, and an MPI library (and related libraries) must be made available to the HDF5 configure. This can be accomplished with the mpicc wrapper script, in the case of MPICH2.
The following works to build HDF5 with parallel I/O on our netCDF testing system:
CC=mpicc ./configure --enable-parallel --prefix=/shecky/local_par --with-zlib=/shecky/local_par --disable-shared && make check install
Optionally, the parallel-netcdf library should also be installed, and you should configure with --enable-pnetcdf. (Note: the previously recommended Unidata replacement pnetcdf.h should no longer be used!).
To build netCDF with parallel I/O, build as usual, but point the configure at a version of HDF5 that has been built for parallel I/O.
CPPFLAGS=-I/shecky/local_par/include CXXFLAGS=-I/shecky/local_par/include FFFLAGS=-I/shecky/local_par/include FCFLAGS=-I/shecky/local_par/include LDFLAGS=-L/shecky/local_par/lib FC=mpif90 CXX=mpicxx CC=mpicc ./configure make check install
To enable the parallel tests, specify –enable-parallel-tests as an option to configure. These tests will be run as mpiexec calls. This may not be appropriate on all systems, especially those which use some queue for jobs.
To use parallel-netcdf to perform parallel I/O on classic and 64-bit offset files, use the –enable-pnetcdf option.
For parallel builds the netCDF examples are not built. This is to avoid cluttering them with MPI_Init/Finalize calls.