[Mpi-forum] Question about the semantics of MPI_Comm_disconnect
hjelmn at lanl.gov
Tue Nov 12 16:27:29 CST 2013
On Tue, Nov 12, 2013 at 04:20:05PM -0600, Rajeev Thakur wrote:
> On Nov 12, 2013, at 4:08 PM, Nathan Hjelm <hjelmn at lanl.gov> wrote:
> > 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."
> The above sentence says that MPI_Comm_free does not wait for pending communication to complete, whereas MPI_Comm_disconnect does.
That makes absolutely no sense if MPI_Wait/MPI_Test cannot be called after MPI_Comm_disconnect. If
neither of those functions can be called after MPI_Comm_disconnect then it would be better wording
that all communication MUST be complete before the call the MPI_Comm_disconnect without any
qualification that MPI_Comm_disconnect with wait until all communication is complete. There should
be no communication otherwise we have to allow MPI_Wait/MPI_Test after the call to MPI_Comm_disconnect.
You see why this is confusing/bad wording in the standard? As an implementor I can not tell what
was intended here.
> > 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.
> You cannot call MPI_Wait after MPI_Comm_disconnect. You can call it after MPI_Comm_free.
I don't see that anywhere in the description of MPI_Comm_disconnect. As far as I can tell the
code snippet I provided is 100% correct MPI code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 833 bytes
Desc: not available
More information about the mpi-forum