How HDF5 Uses The MPI API
Parallel File I/O Options with HDF5 for an MPI Application:
An MPI application has three options when accessing an HDF5 file:
- Each process in the MPI application may independently open a different HDF5 file, using the "sec2" file driver in HDF5 (which is the default HDF5 file driver) and perform I/O actions on it (they may also open the same HDF5 file if they open it for read-only access). In this case, MPI API routines are not involved in operating on the file and the HDF5 library treats this access as if it were occurring from a serial application.
- Each process in the MPI application collectively opens the same file, using the MPI-POSIX file driver in HDF5. In this case, MPI API routines are only used to coordinate access to the file and POSIX I/O routines (open, read, write, etc) are used for file I/O. When this option is chosen, collective I/O is not possible on dataset elements. This option can have significant performance benefits on certain parallel file systems and/or application file access patterns.
- Each process in the MPI application collectively opens the same file, using the MPI-IO file driver in HDF5. In this case, MPI API routines are used for both file I/O and for coordinating access to the file. When this option is chosen, collective I/O on dataset elements is possible. This option can have significant performance benefits on certain parallel file systems and/or application file access patterns.
The rest of this document set assumes that the file was opened with either the MPI-IO or MPI-POSIX file driver. Any discussion of collective I/O assumes that the file was opened with the MPI-IO file driver.
The HDF5 Library uses the MPI API routines in three ways: