9.4.4.3 Seek

If MPI_MODE_SEQUENTIAL mode was specified when the file was opened, it is erroneous to call the following two routines (MPI_FILE_SEEK_SHARED and MPI_FILE_GET_POSITION_SHARED).



MPI_FILE_SEEK_SHARED(fh, offset, whence)

INOUT
fh file handle (handle)
IN
offset file offset (integer)
IN
whence update mode (state)

int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence)



MPI_FILE_SEEK_SHARED(FH, OFFSET, WHENCE, IERROR)INTEGER FH, WHENCE, IERROR
INTEGER(KIND=MPI_OFFSET_KIND) OFFSET



int MPI::File::Seek_shared(MPI::Offset offset, int whence)



void

MPI_FILE_SEEK_SHARED updates the shared file pointer according to whence, which has the following possible values:

MPI_FILE_SEEK_SHARED is collective; all the processes in the communicator group associated with the file handle fh must call MPI_FILE_SEEK_SHARED with the same values for offset and whence.

The offset can be negative, which allows seeking backwards. It is erroneous to seek to a negative position in the view.



MPI_FILE_GET_POSITION_SHARED(fh, offset)

IN
fh file handle (handle)
OUT
offset offset of shared pointer (integer)

int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset)



MPI_FILE_GET_POSITION_SHARED(FH, OFFSET, IERROR)INTEGER FH, IERROR
INTEGER(KIND=MPI_OFFSET_KIND) OFFSET



int MPI::File::Get_position_shared() const



MPI::Offset

MPI_FILE_GET_POSITION_SHARED returns, in offset, the current position of the shared file pointer in etype units relative to the current view.

Advice to users. The offset can be used in a future call to MPI_FILE_SEEK_SHARED using whence = MPI_SEEK_SET to return to the current position. To set the displacement to the current file pointer position, first convert offset into an absolute byte position using MPI_FILE_GET_BYTE_OFFSET, then call MPI_FILE_SET_VIEW with the resulting displacement.(End of advice to users.)

MPI-Standard for MARMOT