From a1754dfe317168efde3cf4885d2416c5a18cccb9 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 2 Jan 2013 18:32:46 +0000 Subject: [PATCH] Don't leave the cid registered in any case. This commit was SVN r27735. --- ompi/communicator/comm.c | 3 +-- ompi/communicator/comm_cid.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ompi/communicator/comm.c b/ompi/communicator/comm.c index a3f6b1e560..f47cd270b2 100644 --- a/ompi/communicator/comm.c +++ b/ompi/communicator/comm.c @@ -915,8 +915,7 @@ int ompi_comm_dup ( ompi_communicator_t * comm, ompi_communicator_t **newcomm ) NULL, /* remote_procs */ comp->c_keyhash, /* attrs */ comp->error_handler, /* error handler */ - (mca_base_component_t *) comp->c_topo_component, - /* topo component */ + (mca_base_component_t *) comp->c_topo_component, /* topo component */ comp->c_local_group, /* local group */ comp ->c_remote_group ); /* remote group */ if ( NULL == newcomp ) { diff --git a/ompi/communicator/comm_cid.c b/ompi/communicator/comm_cid.c index af9f69fdd8..a70338ab50 100644 --- a/ompi/communicator/comm_cid.c +++ b/ompi/communicator/comm_cid.c @@ -237,6 +237,9 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm, ret = (allredfnct)(&nextlocal_cid, &nextcid, 1, MPI_MAX, comm, bridgecomm, local_leader, remote_leader, send_first ); if( OMPI_SUCCESS != ret ) { + OPAL_THREAD_LOCK(&ompi_cid_lock); + ompi_comm_unregister_cid (comm->c_contextid); + OPAL_THREAD_UNLOCK(&ompi_cid_lock); return ret; } if (nextcid == nextlocal_cid) {