diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h index 1400271797f..4157f1d4a70 100644 --- a/src/mpid/ch3/include/mpidimpl.h +++ b/src/mpid/ch3/include/mpidimpl.h @@ -484,7 +484,7 @@ typedef int (*MPIDI_PG_Destroy_fn_t)(MPIDI_PG_t * pg); int MPIDI_VCRT_Create(int size, struct MPIDI_VCRT **vcrt_ptr); int MPIDI_VCRT_Add_ref(struct MPIDI_VCRT *vcrt); -int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect); +int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt); int MPIDI_VCR_Dup(MPIDI_VCR orig_vcr, MPIDI_VCR * new_vcr); int MPIDI_PG_Init(MPIDI_PG_Compare_ids_fn_t, MPIDI_PG_Destroy_fn_t); diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h index d3f47b06519..7eac8a58b90 100644 --- a/src/mpid/ch3/include/mpidpre.h +++ b/src/mpid/ch3/include/mpidpre.h @@ -182,10 +182,6 @@ typedef struct MPIDI_CH3I_comm * waiting for a revoke message before we can release * the context id */ - int is_disconnected; /* set to TRUE if this communicator was - * disconnected as a part of - * MPI_COMM_DISCONNECT; FALSE otherwise. */ - struct MPIDI_VCRT *vcrt; /* virtual connection reference table */ struct MPIDI_VCRT *local_vcrt; /* local virtual connection reference table */ diff --git a/src/mpid/ch3/src/ch3u_comm.c b/src/mpid/ch3/src/ch3u_comm.c index f7f0ffd2f4f..cdc3ac27d43 100644 --- a/src/mpid/ch3/src/ch3u_comm.c +++ b/src/mpid/ch3/src/ch3u_comm.c @@ -171,11 +171,6 @@ int MPIDI_CH3I_Comm_commit_pre_hook(MPIR_Comm *comm) int mpi_errno = MPI_SUCCESS; MPIR_FUNC_ENTER; - /* initialize the is_disconnected variable to FALSE. this will be - * set to TRUE if the communicator is freed by an - * MPI_COMM_DISCONNECT call. */ - comm->dev.is_disconnected = 0; - if (comm == MPIR_Process.comm_world) { comm->rank = MPIR_Process.rank; comm->remote_size = MPIR_Process.size; @@ -287,11 +282,11 @@ int MPIDI_CH3I_Comm_destroy_hook(MPIR_Comm *comm) MPIR_ERR_CHECK(mpi_errno); } - mpi_errno = MPIDI_VCRT_Release(comm->dev.vcrt, comm->dev.is_disconnected); + mpi_errno = MPIDI_VCRT_Release(comm->dev.vcrt); MPIR_ERR_CHECK(mpi_errno); if (comm->comm_kind == MPIR_COMM_KIND__INTERCOMM) { - mpi_errno = MPIDI_VCRT_Release(comm->dev.local_vcrt, comm->dev.is_disconnected); + mpi_errno = MPIDI_VCRT_Release(comm->dev.local_vcrt); MPIR_ERR_CHECK(mpi_errno); } @@ -521,10 +516,7 @@ int MPID_Group_free_hook(MPIR_Group * group_ptr) int mpi_errno = MPI_SUCCESS; if (group_ptr->ch3_vcrt) { - /* FIXME: setting TRUE so vc entries may get released. - * Is there a case we don't want that? - */ - mpi_errno = MPIDI_VCRT_Release(group_ptr->ch3_vcrt, TRUE); + mpi_errno = MPIDI_VCRT_Release(group_ptr->ch3_vcrt); } return mpi_errno; } diff --git a/src/mpid/ch3/src/ch3u_port.c b/src/mpid/ch3/src/ch3u_port.c index 91aaf1f11d5..c0cada40ade 100644 --- a/src/mpid/ch3/src/ch3u_port.c +++ b/src/mpid/ch3/src/ch3u_port.c @@ -548,7 +548,7 @@ static int MPIDI_CH3I_Release_tmp_comm(MPIR_Comm *tmp_comm) { int mpi_errno = MPI_SUCCESS; - mpi_errno = MPIDI_VCRT_Release(tmp_comm->dev.vcrt, FALSE); + mpi_errno = MPIDI_VCRT_Release(tmp_comm->dev.vcrt); MPIR_ERR_CHECK(mpi_errno); MPIR_Free_contextid(tmp_comm->recvcontext_id); diff --git a/src/mpid/ch3/src/mpid_comm_disconnect.c b/src/mpid/ch3/src/mpid_comm_disconnect.c index cec8a198e2f..2809dd51ff3 100644 --- a/src/mpid/ch3/src/mpid_comm_disconnect.c +++ b/src/mpid/ch3/src/mpid_comm_disconnect.c @@ -27,10 +27,6 @@ int MPID_Comm_disconnect(MPIR_Comm *comm_ptr) MPIR_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked"); } - /* it's more than a comm_release, but ok for now */ - /* FIXME: Describe what more might be required */ - /* MPIU_PG_Printall( stdout ); */ - comm_ptr->dev.is_disconnected = 1; mpi_errno = MPIR_Comm_release(comm_ptr); MPIR_ERR_CHECK(mpi_errno); /* If any of the VCs were released by this Comm_release, wait diff --git a/src/mpid/ch3/src/mpid_vc.c b/src/mpid/ch3/src/mpid_vc.c index 2d14fde1a3e..7c9285959ce 100644 --- a/src/mpid/ch3/src/mpid_vc.c +++ b/src/mpid/ch3/src/mpid_vc.c @@ -106,7 +106,7 @@ int MPIDI_VCRT_Add_ref(struct MPIDI_VCRT *vcrt) Notes: @*/ -int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect ) +int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt) { int in_use; int mpi_errno = MPI_SUCCESS; @@ -130,24 +130,8 @@ int MPIDI_VCRT_Release(struct MPIDI_VCRT *vcrt, int isDisconnect ) MPIDI_VC_release_ref(vc, &in_use); - /* Dynamic connections start with a refcount of 2 instead of 1. - * That way we can distinguish between an MPI_Free and an - * MPI_Comm_disconnect. */ - /* XXX DJG FIXME-MT should we be checking this? */ - /* probably not, need to do something like the following instead: */ -#if 0 - if (isDisconnect) { - MPIR_Assert(in_use); - /* FIXME this is still bogus, the VCRT may contain a mix of - * dynamic and non-dynamic VCs, so the ref_count isn't - * guaranteed to have started at 2. The best thing to do might - * be to avoid overloading the reference counting this way and - * use a separate check for dynamic VCs (another flag? compare - * PGs?) */ - MPIR_Object_release_ref(vc, &in_use); - } -#endif - if (isDisconnect && MPIR_Object_get_ref(vc) == 1) { + if (vc->lpid >= MPIR_Process.size && MPIR_Object_get_ref(vc) == 1) { + /* release vc from dynamic process */ MPIDI_VC_release_ref(vc, &in_use); }