[Mpi-forum] Question about the semantics of MPI_Comm_disconnect
Nathan Hjelm
hjelmn at lanl.gov
Tue Nov 12 16:08:55 CST 2013
That doesn't match with the wording on p 400 32-34:
"MPI_COMM_DISCONNECT has the same action as MPI_COMM_FREE, except that it
waits for pending communication to finish internally and enables the guarantee about the
behavior of disconnected processes."
Which suggests that some communication may not be finished when MPI_Comm_disconnect is called. Note
that is is safe to call MPI_Wait after MPI_Comm_disconnect but not after MPI_Finalize.
-Nathan Hjelm
HPC-5, LANL
On Tue, Nov 12, 2013 at 03:55:39PM -0600, Rajeev Thakur wrote:
> It says "This requirement is the same as for MPI_FINALIZE." The text for Finalize on pg 359 has a clue on what the requirement is supposed to mean.
>
> "Before an MPI process invokes MPI_FINALIZE, the process must perform all MPI calls needed to complete its involvement in MPI communications: It must locally complete all MPI operations that it initiated and must execute matching calls needed to complete MPI communications initiated by other processes. For example, if the process executed a nonblocking send, it must eventually call MPI_WAIT, MPI_TEST, MPI_REQUEST_FREE, or any derived function; if the process is the target of a send, then it must post the matching receive; if it is part of a group executing a collective operation, then it must have completed its participation in the operation."
>
> Rajeev
>
>
> On Nov 12, 2013, at 1:02 PM, Nathan Hjelm <hjelmn at lanl.gov> wrote:
>
> > I am trying to understand the semantics of MPI_Comm_disconnect but there is a contradiction in
> > the standard. On page 400, lines 29-31 the standard states:
> >
> >
> >
> > MPI_COMM_DISCONNECT may be called only if all communication is complete and
> > matched, so that buffered data can be delivered to its destination. This requirement is the
> > same as for MPI_FINALIZE.
> >
> >
> >
> > Which suggests that all communication MUST be complete before MPI_Comm_disconnect is called. But
> > if I look at lines 41-43 I see this:
> >
> >
> >
> > Rationale. It would be nice to be able to use MPI_COMM_FREE instead, but that
> > function explicitly does not wait for pending communication to complete. (End of
> > rationale.)
> >
> >
> >
> > Which suggest that there may be pending communication on the communicator when MPI_Comm_disconnect
> > is called.
> >
> >
> >
> > A simple example that *could* be legal depending on the interpretation of the standard:
> >
> > MPI_Isend (..., remote, ..., &req);
> >
> > MPI_Comm_disconnect (remote);
> >
> > MPI_Test (&req, &flag, ...);
> > assert (flag);
> >
> >
> > If 29-31 is correct this is illegal but if 41-43 is correct then the disconnect will complete
> > the request and flag will be set to true. I assume the second interpretation is correct since
> > MPI_Comm_disconnect would have the same semantics of MPI_Comm_free if all communication must
> > be complete. Am I wrong?
> >
> >
> > -Nathan Hjelm
> > HPC-5, LANL
> > _______________________________________________
> > mpi-forum mailing list
> > mpi-forum at lists.mpi-forum.org
> > http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
>
> _______________________________________________
> mpi-forum mailing list
> mpi-forum at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.mpi-forum.org/pipermail/mpi-forum/attachments/20131112/3dceb5c7/attachment-0001.pgp>
More information about the mpi-forum
mailing list