From 327576b2a3b70dd0ef15e185b18b4dc82f89c92c Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 30 Jul 2007 13:01:33 +0000 Subject: [PATCH] Fix incorrect behavior noted by Lisandro Dalcini: when MPI_COMM_SELF is passed to MPI_COMM_FREE, it invoked the error handler on MPI_COMM_WORLD, not on MPI_COMM_FREE. This commit changes the behavior: if MPI_COMM_SELF is passed to MPI_COMM_FREE, we invoke the error handler on MPI_COMM_SELF (not MPI_COMM_WORLD). Fixes trac:1109. This commit was SVN r15682. The following Trac tickets were found above: Ticket 1109 --> https://svn.open-mpi.org/trac/ompi/ticket/1109 --- ompi/mpi/c/comm_free.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ompi/mpi/c/comm_free.c b/ompi/mpi/c/comm_free.c index 94adb476f8..d948baec40 100644 --- a/ompi/mpi/c/comm_free.c +++ b/ompi/mpi/c/comm_free.c @@ -41,9 +41,12 @@ int MPI_Comm_free(MPI_Comm *comm) 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); } }