[mpich-devel] Dynamic process management test case issue?

Archer, Charles J charles.j.archer at intel.com
Fri Feb 21 11:15:48 CST 2014


Hi.

The test case test/mpi/spawn/concurrent_spawns.c mixes MPI_Comm_free with MPI_Comm_disconnect (lines 115/122) from different ranks on the same inter-communicator.

Both MPI_Comm_free and MPI_Comm_disconnect are defined as collective (although possibly implemented with reference counting or non-collective behavior...most MPI's don't synchronize).  As far as I know there is no precedent for mixing different collective calls across ranks in a communicator, so symmetric calls to disconnect or free should be made....but don't mix them.

I understand for free/disconnect, "collective" does not necessarily mean synchronizing, but the specification is clear that comm disconnect/free should be considered collective.  See the test cmfree.c as an example of a test case that relies on collective, but not synchronizing behavior of free().  There is language in the spec indicating that disconnect "has the same action" as free (page 400), but I don't think it implies that you can mix the calls.  Additionally, what does it mean to disconnect one side of the connection?

I can't find any solid evidence that this test case is legal.  At first glance, the example on page 396 of the spec seems to indicate that mixing is allowed.  However mixing cannot happen;  the example is confusing.

If mixing free/disconnect was intentional, I think we probably need some clarification of the MPI spec with regards to this....unless I'm missing something entirely.

Here is a patch that fixes this test case, please weigh in if you have some insight.

diff --git a/test/mpi/spawn/concurrent_spawns.c b/test/mpi/spawn/concurrent_spawns.c
index e44f53a..df82b13 100644
--- a/test/mpi/spawn/concurrent_spawns.c
+++ b/test/mpi/spawn/concurrent_spawns.c
@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
     if (parentcomm != MPI_COMM_NULL)
     {
        MPI_Send(&errs, 1, MPI_INT, 0, 0, parentcomm);
-       MPI_Comm_free( &parentcomm );
+       MPI_Comm_disconnect( &parentcomm );
     }
     else {
        /* Note that the MTest_Finalize get errs only over COMM_WORLD */


More information about the devel mailing list