9.4.1 Data Access Routines

Data is moved between files and processes by issuing read and write calls. There are three orthogonal aspects to data access: positioning (explicit offset vs. implicit file pointer), synchronism (blocking vs. nonblocking and split collective), and coordination (noncollective vs. collective). The following combinations of these data access routines, including two types of file pointers (individual and shared) are provided:

positioning synchronism coordination
noncollective collective
explicit blocking MPI_FILE_READ_AT MPI_FILE_READ_AT_ALL
offsets MPI_FILE_WRITE_AT MPI_FILE_WRITE_AT_ALL
nonblocking & MPI_FILE_IREAD_AT MPI_FILE_READ_AT_ALL_BEGIN
split collective MPI_FILE_READ_AT_ALL_END
MPI_FILE_IWRITE_AT MPI_FILE_WRITE_AT_ALL_BEGIN
MPI_FILE_WRITE_AT_ALL_END
individual blocking MPI_FILE_READ MPI_FILE_READ_ALL
file pointers MPI_FILE_WRITE MPI_FILE_WRITE_ALL
nonblocking & MPI_FILE_IREAD MPI_FILE_READ_ALL_BEGIN
split collective MPI_FILE_READ_ALL_END
MPI_FILE_IWRITE MPI_FILE_WRITE_ALL_BEGIN
MPI_FILE_WRITE_ALL_END
shared blocking MPI_FILE_READ_SHARED MPI_FILE_READ_ORDERED
file pointer MPI_FILE_WRITE_SHARED MPI_FILE_WRITE_ORDERED
nonblocking & MPI_FILE_IREAD_SHARED MPI_FILE_READ_ORDERED_BEGIN
split collective MPI_FILE_READ_ORDERED_END
MPI_FILE_IWRITE_SHARED MPI_FILE_WRITE_ORDERED_BEGIN
MPI_FILE_WRITE_ORDERED_END

POSIX read()/fread() and write()/fwrite() are blocking, noncollective operations and use individual file pointers. The MPI-/ equivalents are MPI_FILE_READ and MPI_FILE_WRITE.

Implementations of data access routines may buffer data to improve performance. This does not affect reads, as the data is always available in the user's buffer after a read operation completes. For writes, however, the MPI_FILE_SYNC routine provides the only guarantee that data has been transferred to the storage device.



Subsections
MPI-Standard for MARMOT