[Mpi-forum] Question about the semantics of MPI_Comm_disconnect

Rajeev Thakur thakur at mcs.anl.gov
Tue Nov 12 15:55:39 CST 2013


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




More information about the mpi-forum mailing list