Page tree

The license could not be verified: License Certificate has expired!

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you are new to HDF5 please read the Learning the Basics topic first. 


Background Color



Overview of Parallel HDF5 (PHDF5) Design

There were several requirements that we had for Parallel HDF5 (PHDF5). These were:


The following shows the Parallel HDF5 implementation layers:

Parallel Programming with HDF5

This tutorial assumes that you are somewhat familiar with parallel programming with MPI (Message Passing Interface).


Please refer to the Supported Configuration Features Summary in the release notes for the current release of HDF5 for an up-to-date list of the platforms that we support Parallel HDF5 on.

Creating and Accessing a File with PHDF5

The programming model for creating and accessing a file is as follows:


Each process of the MPI communicator creates an access template and sets it up with MPI parallel access information. This is done with the H5Pcreate / h5pcreateH5P_fCREATE call to obtain the file access property list and the H5PsetH5P_faplSET_mpio / h5pset_fapl_mpio_fFAPL_MPIO call to set up parallel I/O access.


The following example programs create an HDF5 file using Parallel HDF5:    C      F90

Creating and Accessing a Dataset with PHDF5

The programming model for accessing a dataset with Parallel HDF5 is:

    • Create or open a Parallel HDF5 file with a collective call to:


      H5Dcreate (C) / h5dcreate_f (F90)
      H5Dopen (C) / h5dopen_f (F90)H5D_CREATE


    • Obtain a copy of the file transfer property list and set it to use collective or independent I/O.
      Do this by first passing a data transfer property list class type to: 
      H5Pcreate (C) / h5pcreate_f (F90)H5P_CREATE

      Then set the data transfer mode to either use independent I/O access or to use collective I/O, with a call to:

      H5PsetH5P_dxpl_mpio (C) / h5pset_dxpl_mpio_f (F90)SET_DXPL_MPIO

      Following are the parameters required by this call:

          herr_t H5Pset_dxpl_mpio (hid_t dxpl_id, H5FD_mpio_xfer_t  xfer_mode )
               dxpl_id    IN: Data transfer property list identifier
               xfer_mode  IN: Transfer mode:
                              H5FD_MPIO_INDEPENDENT - use independent I/O access
                              H5FD_MPIO_COLLECTIVE  - use collective I/O access
         h5pset_dxpl_mpi_f (prp_id, data_xfer_mode, hdferr)
               prp_id         IN: Property List Identifer (INTEGER (HID_T))
               data_xfer_mode IN: Data transfer mode  (INTEGER)
                                    H5FD_MPIO_INDEPENDENT_F (0)
                                    H5FD_MPIO_COLLECTIVE_F (1)
               hdferr         IN: Error code  (INTEGER)


    • Access the dataset with the defined transfer property list.

      All processes that have opened a dataset may do collective I/O. Each process may do an independent and arbitrary number of data I/O access calls, using:

      H5Dwrite (C) / h5dwrite_f (F90)
      H5Dread (C) / h5dread_f (F90)H5D_WRITE

      If a dataset is unlimited, you can extend it with a collective call to:

      H5Dextend (C) / h5dextend_f (F90)H5D_EXTEND

The following code demonstrates a collective write using Parallel HDF5:


The following example programs create a dataset in an HDF5 file using Parallel HDF5:    C    F90

Writing and Reading Hyperslabs 

The programming model for writing and reading hyperslabs is:


The memory and file hyperslabs in the first step are defined with the H5Sselect_hyperslab (C) / h5sselect_hyperslab_f (F90) H5S_SELECT_HYPERSLAB.

The start (or offset), count, stride, and block parameters define the portion of the dataset to write to. By changing the values of these parameters you can write hyperslabs with Parallel HDF5 by contiguous hyperslab, by regularly spaced data in a column/row, by patterns, and by chunks:

by Contiguous Hyperslab

by Regularly Spaced Data  

by Pattern  

by Chunk