Next: , Previous: 64 Bit, Up: Building on Unix


3.4 Building on Platforms with Parallel I/O

NetCDF makes available the parallel I/O features of HDF5 and the parallel-netcdf libraries, allowing parallel I/O from netCDF-4 linked programs.

3.4.1 Building HDF5 for Parallel I/O

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

3.4.2 The parallel-netcdf Library

Optionally, the parallel-netcdf library should also be installed, and the replacement for pnetcdf.h should be copied from ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/pnetcdf.h.

3.4.3 Building NetCDF

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.

     FC=mpif90 CXX=mpicxx CC=mpicc ./configure --with-hdf5=/shecky/local_par
     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 (and, optionally, the –with-pnetcdf option to specify a location for the parallel-netcdf library).

     FC=mpif90 CXX=mpicxx CC=mpicc ./configure --with-hdf5=/shecky/local_par --enable-pnetcdf --with-pnetcdf=/shecky/local/pnetcdf
     make check install

For parallel builds the netCDF examples are not built. This is to avoid cluttering them with MPI_Init/Finalize calls.