Re: Clarification of close semantics
Bill Nitzberg (nitzberg@nas.nasa.gov)
Fri, 28 Feb 1997 15:44:31 -0800
Linda Stanberry writes
> > My understanding is that this case is no different from the following
> > clearly legal case:
>
> > Process 0 Process 1
>
> > MPI_Send( node 1, ...)
> > MPI_Finalize()
> > MPI_Receive( node 0, ...)
> > MPI_Finalize()
>
> > The MPI implementation is responsible for ensuring that all requests
> > completed by the user are actually carried out by the system (except
> > when exceptional conditions prevent, e.g, memory overflow).
> > MPI does not require the user to synchronize, nor does it require the
> > implementation to synchronize, but it does require the implementation
> > to ensure that the user's unsynchronized code works.
>
> I think this is different from your example in that MPI_Close is a
> collective call and (if I got this right) MPI_Finalize is not? I'm
> still learning MPI-1 semantics, obviously, but if I understand them
> correctly, it is erroneous for a collective call to be issued
> without synchronizing (making sure no other op is pending). The wording
> for MPI_CLOSE is a little blurry about whether it is erroneous to call
> MPI_CLOSE without synchronizing (1) just on all threads on this node or
> (2) on all threads on all nodes to guarantee that there are no outstanding
> requests on the given file handle.
I don't believe we want to require the user to synchronize
MPI processes before a close, so my understanding of the intent
is case (1) above.
This is misleading, and looking at the text for MPI_FINALIZE in
MPI 1.1, "The user must ensure that all pending communciations
involving a process completes before the process calls MPI_FINALIZE",
perhaps the following would be better (your suggestions welcome):
The user is responsible for ensuring that all outstanding
requests associated with _fh_ made by a process have completed
before that process calls MPI_CLOSE.
I think the confusion is related to the many ways to refer to a
file in MPI: the file itself, one instance of an MPI_Open
(a set of file handles on a group of processes), and a single
file handle. The unclear text in MPI_CLOSE refers to a single file
handle, which is supposed to imply that all local outstanding
operations must be completed (not those on other processes),
although it is not as clear on that point as it could be.
- bill