Reading a File in Non-blocking Mode
Function Syntax
- Read a file from a location specified by a file pointer in non-collective mode.
MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
- Read a file from a location specified by a file pointer in collective mode.
MPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
PMPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
- Read a file at an explicit offset in non-collective mode.
MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
- Read a file at an explicit offset in collective mode.
MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
PMPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
fh |
File (handle) |
Non-empty |
Input |
offset |
Offset |
Integer |
Input |
*buf |
Initial address of the buffer |
Non-empty |
Output |
count |
Number of elements in the buffer |
Non-negative integer |
Input |
datatype |
Data type of each buffer element |
Non-empty |
Input |
*request |
request object (handle) |
Non-empty |
Output |
Return Value
- Success: MPI_SUCCESS
- Failure: An error code is returned.
Error Code
Error Code |
Description |
|---|---|
MPI_ERR_NO_SUCH_FILE |
No such file |
MPI_ERR_BAD_FILE |
Invalid file name |
MPI_ERR_FILE |
Invalid file handle |
MPI_ERR_ARG |
Other invalid arguments |
MPI_ERR_AMODE |
Unsupported access mode |
MPI_ERR_BUFFER |
Invalid buf argument |
MPI_ERR_COUNT |
Invalid count argument |
MPI_ERR_TYPE |
Invalid type argument |
MPI_ERR_DIMS |
Improper dimension |
MPI_ERR_NO_SPACE |
Insufficient space |
MPI_ERR_NO_MEM |
Memory error |
MPI_ERR_IO |
Other I/O errors |
MPI_ERR_ACCESS |
Access denied |
MPI_ERR_OTHER |
Other errors |
Notes
- Hyper IO does not strictly distinguish collective and independent operations.
- The begin and end functions are paired per file handle. The begin function cannot be called again on the same handle until its corresponding end function has been called.
- There is no significant behavioral difference between iread and read.
- Once a file view is set, it must remain consistent across all subsequent read and write operations. Furthermore, etype specified in MPI_File_set_view or PMPI_File_set_view serves as the basic unit for read and write operations.