and monotonically nondecreasing.
A view defines the current set of data visible
and accessible from an open file as an ordered set of etypes.
Each process has its own view of the file,
defined by three quantities:
a displacement, an etype, and a filetype.
The pattern described by a filetype is repeated,
beginning at the displacement, to define the view.
The pattern of repetition is defined to be the same pattern
that MPI_TYPE_CONTIGUOUS would produce if it were passed
the filetype and an arbitrarily large count.
shows how the tiling works; note
that the filetype in this example must have explicit
lower and upper bounds set in order for the initial and final holes to be
repeated in the view.
Views can be changed by the user during program execution.
The default view is a linear byte stream
(displacement is zero, etype and filetype equal to MPI_BYTE).
Figure 25: Etypes and filetypes
A group of processes can use complementary views to
achieve a global data distribution such as a scatter/gather pattern
(see Figure 26
Figure 26: Partitioning a file among parallel processes
An offset is a position
in the file
relative to the current view,
expressed as a count of etypes.
Holes in the view's filetype are skipped when calculating this position.
Offset 0 is the location of the first etype visible in the view
(after skipping the displacement and any initial holes in the view).
For example, an offset of 2 for process 1
in Figure 26
is the position
of the 8th etype in the file after the displacement.
An ``explicit offset'' is an offset that is used as a formal parameter
in explicit data access routines.
file size and end of file
The size of an MPI file is measured in bytes from the
beginning of the file. A newly created file has a size of zero
bytes. Using the size as an absolute displacement gives
the position of the byte immediately following the last byte in
the file. For any given view, the end of file is the
offset of the first etype accessible in the current view starting
after the last byte in the file.
A file pointer is an implicit offset maintained by MPI.
``Individual file pointers'' are file pointers that are local to
each process that opened the file.
A ``shared file pointer'' is a file pointer that is shared by
the group of processes that opened the file.
A file handle is an opaque object created by MPI_FILE_OPEN
and freed by MPI_FILE_CLOSE.
All operations on an open file
reference the file through the file handle.