9.4.1.1 Positioning

MPI-/ provides three types of positioning for data access routines: explicit offsets, individual file pointers, and shared file pointers. The different positioning methods may be mixed within the same program and do not affect each other.

The data access routines that accept explicit offsets contain _AT in their name (e.g., MPI_FILE_WRITE_AT). Explicit offset operations perform data access at the file position given directly as an argument--no file pointer is used nor updated. Note that this is not equivalent to an atomic seek-and-read or seek-and-write operation, as no ``seek'' is issued. Operations with explicit offsets are described in Section 9.4.2, page [*].

The names of the individual file pointer routines contain no positional qualifier (e.g., MPI_FILE_WRITE). Operations with individual file pointers are described in Section 9.4.3, page [*]. The data access routines that use shared file pointers contain _SHARED or _ORDERED in their name (e.g., MPI_FILE_WRITE_SHARED). Operations with shared file pointers are described in Section 9.4.4, page [*].

The main semantic issues with MPI-/-maintained file pointers are how and when they are updated by I/O operations. In general, each I/O operation leaves the file pointer pointing to the next data item after the last one that is accessed by the operation. In a nonblocking or split collective operation, the pointer is updated by the call that initiates the I/O, possibly before the access completes.

More formally,

\begin{displaymath}
\mbox{\it new\_file\_offset} = \mbox{\it old\_file\_offset} +
\frac{elements(datatype)}{elements(etype)} \times count
\end{displaymath}

where $count$ is the number of $datatype$ items to be accessed, $elements(X)$ is the number of predefined datatypes in the typemap of $X$, and $\it old\_file\_offset$ is the value of the implicit offset before the call. The file position, $\it new\_file\_offset$, is in terms of a count of etypes relative to the current view.

MPI-Standard for MARMOT