Setting and Getting the File Data View of a Process in Collective Mode
Function Syntax
- Change the process's view of the data in the file.
MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char* datarep, MPI_Info info)
PMPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char* datarep, MPI_Info info)
- Get the process's view of the data in the fil.
MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char* datarep)
PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char* datarep)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
fh |
Handle of the file to be deleted |
Non-empty |
Input |
disp |
Displacement |
Non-negative integer |
Input |
*disp |
Destination address for storing the displacement |
Non-empty |
Output |
etype |
Basic data type (handle) |
Non-empty |
Input |
*etype |
Destination address for storing the basic data type (handle) |
Non-empty |
Output |
filetype |
File type (handle) |
Non-empty |
Input |
*filetype |
Destination address for storing the file type |
Non-empty |
Output |
const *datarep |
Data representation |
Non-empty |
Input |
*datarep |
Destination address for storing the data representation |
Non-empty |
Output |
info |
info object (handle) |
Non-empty |
Input |
Return Value
- Success: MPI_SUCCESS
- Failure: An error code is returned.
Error Code
Error Code |
Description |
|---|---|
MPI_ERR_FILE |
Invalid file handle |
MPI_ERR_DISP |
Invalid disp argument |
MPI_ERR_TYPE |
Invalid data type (handle) argument |
MPI_ERR_ARG |
Other invalid arguments |
Notes
The input parameter etype for MPI_File_set_view or PMPI_File_set_view can only be a basic MPI data type. The view must remain consistent between read and write operations. Once the view is set, etype serves as the basic unit for read and write operations.