MPI file view
An MPI file view selects an ordered sequence of elementary data items from a file using a byte displacement and a repeating datatype pattern.
Coordinates: disp is an absolute byte displacement, but an I/O offset counts etypes visible through the view and skips holes. Offset zero is the first visible etype, which need not start at disp. MPI_File_get_byte_offset converts a view-relative offset to an absolute byte position. [1][2]
Repetition: the filetype repeats at its extent, not its payload size. With disp 128 bytes, contiguous four-byte etypes at positions 0 and 8, and filetype extent 16 bytes, offsets 0, 1, 2 map to bytes 128, 136, 144. An extent of 12 instead maps offset 2 to byte 140. [1][3][7]
MPI_File_set_view is collective and resets individual and shared file pointers to zero. Processes may use different displacements and filetypes, but must agree on datarep and the file-representation extent of etype. The supplied datatypes must be committed. [4]
The view describes file layout; a read or write has a separate memory-buffer datatype. Explicit-offset operations do not advance file pointers. MPI_File_read_at_all combines an explicit view-relative offset with collective participation. [5]
Exposing a full noncontiguous request enables optimizations such as data sieving and collective buffering. A view does not guarantee fewer device requests or faster execution, and is not a physical disk map. [6]
Relations
- related
- Collective I/O, Two-phase I/O
Citations
- MPI 4.1, I/O definitions: displacement, etype, filetype, view and offset
- MPI 4.1, Individual file pointers: MPI_File_get_byte_offset
- MPI 4.1, Extent and bounds of datatypes
- MPI 4.1, File views: MPI_File_set_view
- MPI 4.1, Data access routines and positioning
- Thakur, Gropp and Lusk. Data Sieving and Collective I/O in ROMIO. Frontiers 1999.
- Hesela: exact MPI file-view offset example
Sources & caveats
- The worked example uses contiguous etypes with equal size and extent. It is exact layout arithmetic, not an MPI implementation test or a performance benchmark.
- Semantics are scoped to MPI 4.1. ROMIO 1999 supplies historical optimization context, not a prediction for current hardware.