Home

MPIFile

MPIFile refers to the file handle used in the MPI-IO facilities of the Message Passing Interface (MPI). An MPI_File represents an opened file that can be accessed by multiple processes in a parallel program. Files are opened with MPI_File_open and closed with MPI_File_close. I/O can be performed collectively or independently, using routines such as MPI_File_read, MPI_File_write, and their position-based variants like MPI_File_read_at and MPI_File_write_at, as well as their collective forms (e.g., MPI_File_read_all, MPI_File_write_at_all). These routines operate on an MPI_File handle, a memory buffer, a count, an MPI_Datatype, and an optional status.

Access layout is described by a file view, set with MPI_File_set_view. The view defines how elements in

File pointers can be managed in two ways. Each process maintains an individual file pointer for non-at

Performance in MPI-IO depends on the MPI implementation and the underlying file system. MPI_Info can be used

memory
map
to
bytes
in
the
file
via
an
etype
(the
basic
element
type)
and
a
filetype
(which
may
be
a
derived
datatype).
Offsets
are
given
in
MPI_Offset,
which
allows
both
absolute
and
relative
positioning
within
the
file.
Memory
and
file
representations
are
coordinated
through
the
datatype
mechanism,
enabling
complex,
noncontiguous
I/O
patterns.
operations,
while
a
shared
file
pointer
can
be
manipulated
with
MPI_File_seek_shared
and
queried
with
MPI_File_get_position_shared.
The
explicit-offset
operations
(read_at,
write_at)
do
not
depend
on
the
current
file
pointer.
to
pass
hints
(for
example,
I/O
behavior,
striping,
or
buffering).
MPI-IO
provides
a
portable
framework
for
scalable
parallel
file
access,
with
behavior
that
may
vary
across
systems
and
implementations.