hdf images hdf images

This web site is no longer updated (but will remain online).
Please see The HDF Group's new Support Portal for the latest information.

Creating / 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 / h5pcreate_f call to obtain the file access property list and the H5Pset_fapl_mpio / h5pset_fapl_mpio_f call to set up parallel I/O access.

Following is example code for creating an access template in HDF5:

C:
    23      MPI_Comm comm  = MPI_COMM_WORLD;
    24      MPI_Info info  = MPI_INFO_NULL;
    25
    26      /*
    27       * Initialize MPI
    28       */
    29      MPI_Init(&argc, &argv);
    30      MPI_Comm_size(comm, &mpi_size);
    31      MPI_Comm_rank(comm, &mpi_rank);
    32
    33      /*
    34       * Set up file access property list with parallel I/O access
    35       */
    36      plist_id = H5Pcreate(H5P_FILE_ACCESS);
    37      H5Pset_fapl_mpio(plist_id, comm, info);

FORTRAN90:
    23       comm = MPI_COMM_WORLD
    24       info = MPI_INFO_NULL
    25
    26       CALL MPI_INIT(mpierror)
    27       CALL MPI_COMM_SIZE(comm, mpi_size, mpierror)
    28       CALL MPI_COMM_RANK(comm, mpi_rank, mpierror)
    29       !
    30       ! Initialize FORTRAN interface 
    31       !
    32       CALL h5open_f(error)
    33
    34       !
    35       ! Setup file access property list with parallel I/O access.
    36       !
    37       CALL h5pcreate_f(H5P_FILE_ACCESS_F, plist_id, error)
    38       CALL h5pset_fapl_mpio_f(plist_id, comm, info, error)

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



- - Last modified: 21 December 2016