[ HDF5 Tutorial Top ] [ Parallel HDF5 Topics Top ] [ Next ] [ Prev ]

Creating / Accessing a Dataset with PHDF5

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

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

  2. 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:

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

    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)

  3. Access the dataset with the defined transfer property list.

The following code demonstrates a collective write using Parallel HDF5:

    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);
   101      status = H5Dwrite (dset_id, H5T_NATIVE_INT, memspace, filespace,
   102                plist_id, data);

   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)
   113       !
   114       ! Write the dataset collectively.
   115       !
   116       CALL h5dwrite_f (dset_id, H5T_NATIVE_INTEGER, data, 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:

The National Center for Supercomputing Applications

University of Illinois at Urbana-Champaign


Last Modified: December 14, 2001