[mpich] MPICH primary repository branch, master, updated. v3.2b4-80-g4096fe9
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 4096fe9f4d97ce54244995c5e459e26637be272f (commit) via 24a5f95441047c9c5c8738d0c7515355fe81bd82 (commit) from 6b640b5f0aa5886add15e38c6eb77e41196605f7 (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/4096fe9f4d97ce54244995c5e459e26637... commit 4096fe9f4d97ce54244995c5e459e26637be272f Author: Huiwei Lu <[email protected]> Date: Thu Aug 6 10:58:54 2015 -0500 Deprecate single-threaded MPIR_Get_contextid_sparse_group The single-threaded MPIR_Get_contextid_sparse_group is outdated and buggy, which does not consider the overlapping use of itself and MPI_Comm_idup. The multi-threaded implementation has already fixed that and has better error handling, there is no reason to still keep the single-threaded version. Fixes #2295, #2297 Signed-off-by: Lena Oden <[email protected]> diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c index 2b6bd31..dee8775 100644 --- a/src/mpi/comm/commutil.c +++ b/src/mpi/comm/commutil.c @@ -975,98 +975,6 @@ static volatile int mask_in_use = 0; static volatile int lowestContextId = MPIR_MAXID; static volatile int lowestTag = -1; -#ifndef MPICH_IS_THREADED -/* Unthreaded (only one MPI call active at any time) */ - -#undef FUNCNAME -#define FUNCNAME MPIR_Get_contextid_sparse -#undef FCNAME -#define FCNAME MPIU_QUOTE(FUNCNAME) -int MPIR_Get_contextid_sparse(MPID_Comm *comm_ptr, MPIR_Context_id_t *context_id, int ignore_id) -{ - return MPIR_Get_contextid_sparse_group(comm_ptr, NULL /* group_ptr */, MPIR_Process.attrs.tag_ub /* tag */, context_id, ignore_id); -} - -#undef FUNCNAME -#define FUNCNAME MPIR_Get_contextid_sparse_group -#undef FCNAME -#define FCNAME MPIU_QUOTE(FUNCNAME) -int MPIR_Get_contextid_sparse_group(MPID_Comm *comm_ptr, MPID_Group *group_ptr, int tag, MPIR_Context_id_t *context_id, int ignore_id) -{ - 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; - - 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 if (comm_ptr->idup_count && seqnum != comm_ptr->idup_next_seqnum) { - memset(local_mask, 0, MPIR_MAX_CONTEXT_MASK * sizeof(int)); - } - else { - MPIU_Memcpy(local_mask, context_mask, 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); - } - - 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); - } - } - else { - *context_id = MPIR_Find_and_allocate_context_id(local_mask); - } - } - if (seqnum > 0) - comm_ptr->idup_next_seqnum++; - -fn_exit: - if (ignore_id) - *context_id = MPIR_INVALID_CONTEXT_ID; - MPIU_DBG_MSG_S(COMM,VERBOSE,"Context mask = %s",MPIR_ContextMaskToStr()); - - MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_GET_CONTEXTID); - return mpi_errno; -fn_fail: - goto fn_exit; -} - -#else /* MPICH_IS_THREADED is set and true */ - #undef FUNCNAME #define FUNCNAME MPIR_Get_contextid_sparse #undef FCNAME @@ -1354,8 +1262,6 @@ fn_fail: /* --END ERROR HANDLING-- */ } -#endif - struct gcn_state { MPIR_Context_id_t *ctx0; MPIR_Context_id_t *ctx1; http://git.mpich.org/mpich.git/commitdiff/24a5f95441047c9c5c8738d0c7515355fe... commit 24a5f95441047c9c5c8738d0c7515355fe81bd82 Author: Huiwei Lu <[email protected]> Date: Wed Aug 5 13:07:25 2015 -0500 Fixing a copy-paste error in comm_idup_comm2 comm_idup_comm2.c is copied from comm_idup_comm.c, while modifing it to do overlapping communicator operations on a separate communicator. However, the group related to the separate communicator was not changed accordingly, thus causes a user error in MPI_Comm_create_group. Ref #2295 Signed-off-by: Lena Oden <[email protected]> diff --git a/test/mpi/comm/comm_idup_comm2.c b/test/mpi/comm/comm_idup_comm2.c index dd476dc..bf70824 100644 --- a/test/mpi/comm/comm_idup_comm2.c +++ b/test/mpi/comm/comm_idup_comm2.c @@ -22,7 +22,7 @@ int main(int argc, char **argv) int *excl; int ranges[1][3]; int isLeft, rleader; - MPI_Group world_group, high_group, even_group; + MPI_Group dup_group, high_group, even_group; MPI_Comm local_comm, inter_comm, test_comm, outcomm, dupcomm; MPI_Comm idupcomms[NUM_IDUPS]; MPI_Request reqs[NUM_IDUPS]; @@ -30,8 +30,8 @@ int main(int argc, char **argv) MTest_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_group(MPI_COMM_WORLD, &world_group); MPI_Comm_dup(MPI_COMM_WORLD, &dupcomm); + MPI_Comm_group(dupcomm, &dup_group); if (size < 2) { printf("this test requires at least 2 processes\n"); @@ -59,7 +59,7 @@ int main(int argc, char **argv) ranges[0][0] = size / 2; ranges[0][1] = size - 1; ranges[0][2] = 1; - MPI_Group_range_incl(world_group, 1, ranges, &high_group); + MPI_Group_range_incl(dup_group, 1, ranges, &high_group); MPI_Comm_create(dupcomm, high_group, &outcomm); MPI_Group_free(&high_group); errs += MTestTestComm(outcomm); @@ -71,7 +71,7 @@ int main(int argc, char **argv) for (i = 0; i < size / 2; i++) excl[i] = (2 * i) + 1; - MPI_Group_excl(world_group, size / 2, excl, &even_group); + MPI_Group_excl(dup_group, size / 2, excl, &even_group); free(excl); if (rank % 2 == 0) { @@ -115,7 +115,7 @@ int main(int argc, char **argv) MPI_Comm_free(&idupcomms[i]); } - MPI_Group_free(&world_group); + MPI_Group_free(&dup_group); MPI_Comm_free(&dupcomm); MTest_Finalize(errs); ----------------------------------------------------------------------- Summary of changes: src/mpi/comm/commutil.c | 94 --------------------------------------- test/mpi/comm/comm_idup_comm2.c | 10 ++-- 2 files changed, 5 insertions(+), 99 deletions(-) hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org