Purpose
Associates a new view with the open file.
C synopsis
#include <mpi.h> int MPI_File_set_view (MPI_File fh,MPI_Offset disp, MPI_Datatype etype,MPI_Datatype filetype, char *datarep,MPI_Info info);
C++ synopsis
#include mpi.h void MPI::File::Set_view(MPI::Offset disp, const MPI::Datatype& etype, const MPI::Datatype& filetype, const char* datarep, const MPI::Info& info);
FORTRAN synopsis
include 'mpif.h' or use mpi MPI_FILE_SET_VIEW (INTEGER FH,INTEGER(KIND=MPI_OFFSET_KIND) DISP, INTEGER ETYPE,INTEGER FILETYPE,CHARACTER DATAREP(*),INTEGER INFO, INTEGER IERROR)
Parameters
Description
This subroutine associates a new view defined by disp, etype, filetype, and datarep with the open file referred to by fh. This is a collective operation. All participating tasks must specify the same values for datarep and the same extents for etype.
There are no further restrictions on etype and filetype, except those referred to in the MPI-2 standard. No checking is performed on the validity of these datatypes. If I/O operations are pending on fh, an error is returned to the participating tasks and the new view is not associated with the file.
The effective use of MPI_FILE_SET_VIEW by each task of a file group can be critical to obtaining the performance benefits of MPI-IO. When the tasks each set a file view that is complementary to the views set by other tasks and use collective MPI-IO operations in conjunction with these views, the MPI library has the information that will allow it to optimize the I/O. Without the information available in the file view settings, fewer opportunities for optimization by MPI-IO exist.
Valid values for datarep are:
File hints can be associated with a file when a view is set on it. MPI_FILE_SET_VIEW ignores the hint value if it is not valid. Any info key, value pair the user provides will either be accepted or ignored. There will never be an error returned or change in semantic as a result of a hint.
See Table 3 for a list of supported file hints.
Notes
Note that when you specify a value for the disp argument, constants of the appropriate type should be used. In FORTRAN, constants of type INTEGER(KIND=8) should be used, for example, 45_8.
It is expected that a call to MPI_FILE_SET_VIEW will immediately follow MPI_FILE_OPEN in many instances.
Parameter consistency checking is only performed if the environment variable MP_EUIDEVELOP is set to yes. If this variable is set and the extents of the elementary datatypes specified are not identical, the error Inconsistent elementary datatypes will be raised on some tasks and the error Consistency error occurred on another task will be raised on the other tasks.
Errors
Fatal errors:
Returning errors (MPI error class):
Related information