If you are new to HDF5 please read the Learning the Basics topic first.
Contents:
- Overview of Parallel HDF5 (PHDF5) Design
- Parallel Programming with HDF5arallel Programming with HDF5
- Creating and Accessing a File with PHDF5
- Creating and Accessing a Dataset with PHDF5
- Writing and Reading Hyperslabs
Background Color | ||
---|---|---|
| ||
|
Anchor overview overview
Overview of Parallel HDF5 (PHDF5) Design
overview | |
overview |
There were several requirements that we had for Parallel HDF5 (PHDF5). These were:
...
The following shows the Parallel HDF5 implementation layers:
Anchor pprog pprog
Parallel Programming with HDF5
pprog | |
pprog |
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.
Anchor crtfile crtfile
Creating and Accessing a File with PHDF5
crtfile | |
crtfile |
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
Anchor crtdat crtdat
Creating and Accessing a Dataset with PHDF5
crtdat | |
crtdat |
The programming model for accessing a dataset with Parallel HDF5 is:
- Create or open a Parallel HDF5 file with a collective call to:
H5Dopen (C) / h5dopen_f (F90)H5D_CREATE
H5D_OPEN - 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_CREATEThen 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_MPIOFollowing are the parameters required by this call:
C: 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 (default) H5FD_MPIO_COLLECTIVE - use collective I/O access F90: 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
H5D_READIf a dataset is unlimited, you can extend it with a collective call to:
- Create or open a Parallel HDF5 file with a collective call to:
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
Anchor | ||||
---|---|---|---|---|
|
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: