The programming model for accessing a dataset with Parallel HDF5 is:
H5Dcreate, H5Dopen
h5dcreate_f, h5dopen_f
H5Pcreateh5pcreate_f
Then set the data transfer mode to either use independent I/O access or to use collective I/O, with a call to:
H5Pset_dxpl_mpioh5pset_dxpl_mpio_f
Following 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)
H5Dwrite, H5Dreadh5dwrite_f, h5dread_f
H5Dextendh5dextend_f
The following code demonstrates a collective write using Parallel HDF5:
C:
95 /*
96 * Create property list for collective dataset write.
97 */
98 plist_id = H5Pcreate (H5P_DATASET_XFER);
99 H5Pset_dxpl_mpio (plist_id, H5FD_MPIO_COLLECTIVE);
100
101 status = H5Dwrite (dset_id, H5T_NATIVE_INT, memspace, filespace,
102 plist_id, data);
F90:
108 ! Create property list for collective dataset write
109 !
110 CALL h5pcreate_f (H5P_DATASET_XFER_F, plist_id, error)
111 CALL h5pset_dxpl_mpio_f (plist_id, H5FD_MPIO_COLLECTIVE_F, error)
112
113 !
114 ! Write the dataset collectively.
115 !
116 CALL h5dwrite_f (dset_id, H5T_NATIVE_INTEGER, data, dimsfi, error, &
117 file_space_id = filespace, mem_space_id = memspace, xfer_prp = plist_id)
The following example programs create a dataset in an HDF5 file using
Parallel HDF5:
Dataset.cdataset.f90
The HDF Group
Last Modified: February 20, 2007