It looks like there is a check for COMM_SELF in comm_free.c that explicitly calls the error handler on COMM_WORLD; it looks like this was introduced in the very first implementation of COMM_FREE way back in r983.

I don't see any reason why this would be the case; I'm guessing it's a bug but I'm going to defer to Edgar in case there are any esoteric reasons why this is so...

If not, here's a patch:

Index: comm_free.c
===================================================================
--- comm_free.c (revision 15670)
+++ comm_free.c (working copy)
@@ -41,9 +41,12 @@
         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);

         if ( NULL == *comm  || MPI_COMM_WORLD == *comm ||
-             MPI_COMM_SELF == *comm  || ompi_comm_invalid (*comm)) {
+             ompi_comm_invalid (*comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
                                           FUNC_NAME);
+        } else if (MPI_COMM_SELF == *comm) {
+            return OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, MPI_ERR_COMM,
+                                          FUNC_NAME);
         }
     }


On Jul 28, 2007, at 4:59 PM, Lisandro Dalcin wrote:

I tried to free COMM_SELF, and it seems to call the error handler
attached to COMM_WORLD. Is this intended? Should'nt OMPI use the error
handler to COMM_SELF?

As reference, I tried this with MPICH2, and of course the call fails,
but using the error handler in COMM_SELF.

Again, this is a new corner case AFAIK not taked into account in the standard.

Regards,

--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

_______________________________________________
devel mailing list
de...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/devel


--
Jeff Squyres
Cisco Systems


Reply via email to