Reading a File with an Explicit Offset
Function Syntax
- Read a file at an explicit offset in blocking non-collective mode.
MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
- Read a file at an explicit offset in blocking collective mode.
MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
- Read a file at an explicit offset at the beginning of a split collective routine.
MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype)
PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype)
- Read a file at an explicit offset at the end of a split collective routine.
MPI_File_read_at_all_end(MPI_File fh, void* buf, MPI_Status *status)
PMPI_File_read_at_all_end(MPI_File fh, void* buf, MPI_Status *status)
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 |
*status |
status 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_IN_STATUS |
Split operation already initiated |
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.
- 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.