This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via 24bb936af9c34cc7a7230bb0b41387bdd4ec99df (commit) via 7b0084a18b0d168a46e2202af74dbabd39357eb1 (commit) from 22a77dceda11da45d939e82f1c60618fd1439bea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/24bb936af9c34cc7a7230bb0b41387bdd4... commit 24bb936af9c34cc7a7230bb0b41387bdd4ec99df Author: Huiwei Lu <[email protected]> Date: Tue Jul 28 14:27:24 2015 -0500 Fixes counters in multithreaded MPIR_Get_contextid_sparse_group The counter of idup_next_seqnum of the parent communicator need to be increased accordingly when allocating context id finishes so that the counters for multiple runs of MPI_Comm_idup and MPI_Comm_dup are set correctly. Refs #2291, #2286 Signed-off-by: Lena Oden <[email protected]> diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c index 8248dfc..58b0522 100644 --- a/src/mpi/comm/commutil.c +++ b/src/mpi/comm/commutil.c @@ -1106,7 +1106,7 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm *comm_ptr, MPID_Group *group_ptr, int own_eager_mask = 0; mpir_errflag_t errflag = MPIR_ERR_NONE; int first_iter = 1; - int seqnum; + int seqnum = 0; MPID_MPI_STATE_DECL(MPID_STATE_MPIR_GET_CONTEXTID); MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_GET_CONTEXTID); @@ -1332,6 +1332,8 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm *comm_ptr, MPID_Group *group_ptr, first_iter = 0; } + if (seqnum > 0) + comm_ptr->idup_next_seqnum++; fn_exit: http://git.mpich.org/mpich.git/commitdiff/7b0084a18b0d168a46e2202af74dbabd39... commit 7b0084a18b0d168a46e2202af74dbabd39357eb1 Author: Huiwei Lu <[email protected]> Date: Mon Jul 27 17:18:09 2015 -0500 Fix single-threaded MPIR_Get_contextid_sparse_group The single-threaded case of MPIR_Get_contextid_sparse_group does not consider the mixing use of MPI_Comm_dup (and similar communicator duplication functions) and MPI_Comm_idup, which will cause the MPI_Comm_dup to fail. The fix is similar to #2286. It will use a sequence number to order different MPI_Comm_dup's and MPI_Comm_idup's when they are duplicating from the same parent communicator. Fixes #2291 Signed-off-by: Lena Oden <[email protected]> diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c index 978e936..8248dfc 100644 --- a/src/mpi/comm/commutil.c +++ b/src/mpi/comm/commutil.c @@ -996,61 +996,63 @@ int MPIR_Get_contextid_sparse_group(MPID_Comm *comm_ptr, MPID_Group *group_ptr, int mpi_errno = MPI_SUCCESS; uint32_t local_mask[MPIR_MAX_CONTEXT_MASK]; mpir_errflag_t errflag = MPIR_ERR_NONE; + int seqnum = 0; + if (comm_ptr->idup_count) + seqnum = comm_ptr->idup_curr_seqnum++; MPID_MPI_STATE_DECL(MPID_STATE_MPIR_GET_CONTEXTID); MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_GET_CONTEXTID); *context_id = 0; - if (initialize_context_mask) { - MPIR_Init_contextid(); - } + while (*context_id == 0) { + if (initialize_context_mask) { + MPIR_Init_contextid(); + } - if (ignore_id) { - /* We are not participating in the resulting communicator, so our - * context ID space doesn't matter. Set the mask to "all available". */ - memset(local_mask, 0xff, MPIR_MAX_CONTEXT_MASK * sizeof(int)); - } - else { - MPIU_Memcpy( local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int) ); - } + if (ignore_id) { + /* We are not participating in the resulting communicator, so our + * context ID space doesn't matter. Set the mask to "all available". */ + memset(local_mask, 0xff, MPIR_MAX_CONTEXT_MASK * sizeof(int)); + } + else { + MPIU_Memcpy(local_mask, context_mask, MPIR_MAX_CONTEXT_MASK * sizeof(int)); + } + if (comm_ptr->idup_count && seqnum != comm_ptr->idup_next_seqnum) { + memset(local_mask, 0, MPIR_MAX_CONTEXT_MASK * sizeof(int)); + } - /* Note that this is the unthreaded version */ - /* Comm must be an intracommunicator */ - if (group_ptr != NULL) { - int coll_tag = tag | MPIR_Process.tagged_coll_mask; /* Shift tag into the tagged coll space */ - mpi_errno = MPIR_Allreduce_group( MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK, - MPI_INT, MPI_BAND, comm_ptr, group_ptr, coll_tag, &errflag ); - } else { - mpi_errno = MPIR_Allreduce_impl( MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK, - MPI_INT, MPI_BAND, comm_ptr, &errflag ); - } + /* Note that this is the unthreaded version */ + /* Comm must be an intracommunicator */ + if (group_ptr != NULL) { + int coll_tag = tag | MPIR_Process.tagged_coll_mask; /* Shift tag into the tagged coll space */ + mpi_errno = MPIR_Allreduce_group(MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK, + MPI_INT, MPI_BAND, comm_ptr, group_ptr, coll_tag, &errflag); + } else { + mpi_errno = MPIR_Allreduce_impl(MPI_IN_PLACE, local_mask, MPIR_MAX_CONTEXT_MASK, + MPI_INT, MPI_BAND, comm_ptr, &errflag); + } - if (mpi_errno) MPIU_ERR_POP(mpi_errno); - MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail"); + if (mpi_errno) MPIU_ERR_POP(mpi_errno); + MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail"); - if (ignore_id) { - *context_id = MPIR_Locate_context_bit(local_mask); - if (*context_id == 0) { - int nfree = -1; - int ntotal = -1; - MPIR_ContextMaskStats(&nfree, &ntotal); - MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER, - "**toomanycomm", "**toomanycomm %d %d %d", - nfree, ntotal, ignore_id); + if (ignore_id) { + *context_id = MPIR_Locate_context_bit(local_mask); + if (*context_id == 0) { + int nfree = -1; + int ntotal = -1; + MPIR_ContextMaskStats(&nfree, &ntotal); + MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER, + "**toomanycomm", "**toomanycomm %d %d %d", + nfree, ntotal, ignore_id); + } } - } - else { - *context_id = MPIR_Find_and_allocate_context_id(local_mask); - if (*context_id == 0) { - int nfree = -1; - int ntotal = -1; - MPIR_ContextMaskStats(&nfree, &ntotal); - MPIU_ERR_SETANDJUMP3(mpi_errno, MPI_ERR_OTHER, - "**toomanycomm", "**toomanycomm %d %d %d", - nfree, ntotal, ignore_id); + else { + *context_id = MPIR_Find_and_allocate_context_id(local_mask); } } + if (seqnum > 0) + comm_ptr->idup_next_seqnum++; fn_exit: if (ignore_id) ----------------------------------------------------------------------- Summary of changes: src/mpi/comm/commutil.c | 90 ++++++++++++++++++++++++---------------------- 1 files changed, 47 insertions(+), 43 deletions(-) hooks/post-receive -- MPICH primary repository