Sequential I/O (stripped-down proposal)

Nick Maclaren (nmm1@cus.cam.ac.uk)
Tue, 04 Feb 1997 22:32:16 +0000

This is what I feel is the bare minimum to support true sequential I/O
(i.e. permit it to tapes, pipes and sockets) in a clean fashion. The
main changes from my previous proposal are that I have dropped all
support for the update or repositioning of sequential files, as well as
effectively all optional facilities. Such things could be restored
later (e.g. in MPI 2.5).

Note that I have not mentioned blocking versus non-blocking I/O, as that
is really only an efficiency point and does not affect the semantics.
Similarly, specifying matched versus unmatched transfers in the hints is
only an efficiency point. In fact, all of the following changes have
one objective: to permit sequential I/O while preserving the semantics
of consistency as defined in section 10.6.1.

10.2.1 Opening a File
----------------------

A) AMODE is extended by the following modes, of which only one can
be set and which default to MPI_RANDOM:

MPI_RANDOM - C-style random access, as at present
MPI_SEQUENTIAL - Fortran-style sequential access

It is erroneous to specify MPI_SEQUENTIAL together with MPI_RDWR.

B) There may be implementation dependent restrictions on which modes
may be set in AMODE for certain files, and any such failures will return
errors in the class MPI_ERR_IO.

10.2.6 Resizing a File
-----------------------

C) If AMODE includes MPI_SEQUENTIAL, it is erroneous to call
MPI_RESIZE.

10.3 FILE Views
----------------

D) If AMODE includes MPI_SEQUENTIAL, it is erroneous to call
MPI_FILE_SET_VIEW unless all processes use the same file view.

E) If AMODE includes MPI_SEQUENTIAL and does not include MPI_RDONLY,
implicitly or explicitly, it is erroneous to call MPI_FILE_SET_VIEW with
a filetype that has holes.

F) If AMODE includes MPI_SEQUENTIAL, it is erroneous to call
MPI_FILE_SET_VIEW with a value of DISP other than the following:

a) If AMODE includes MPI_RDONLY, implicitly or explicitly, a
value of DISP less than the value of BYTE_OFFSET that would be returned
from MPI_FILE_GET_POSITION_SHARED. This is initially zero, of course.

b) If AMODE does not include MPI_RDONLY, implicitly or
explicitly, a value of DISP other than the value of BYTE_OFFSET that
would be returned from MPI_FILE_GET_POSITION_SHARED.

10.4.2 Data Access With Explicit Offsets
-----------------------------------------

G) If AMODE includes MPI_SEQUENTIAL, it is erroneous to call any of
the routines in section 10.4.2.

10.4.3 Data Access With Individual File Pointers
-------------------------------------------------

H) If AMODE includes MPI_SEQUENTIAL, it is erroneous to call any of
the routines in section 10.4.3.

10.4.4 Data Access With Shared File Pointers
---------------------------------------------

I) If AMODE includes MPI_SEQUENTIAL, it is erroneous to call
MPI_SEEK_SHARED.

10.6.1 File Consistency
------------------------

J) As far as consistency is concerned, if AMODE includes
MPI_SEQUENTIAL, a write operation has the effect of a call to
MPI_RESIZE (assuming that were permitted) immediately followed by a data
transfer.

Nick Maclaren,
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679