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 702baeed4b46166aea2b292ac556f0b2589cc8f3 (commit) from 5662f72d7bdb4fdcad23a98214f76836aac8c15d (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/702baeed4b46166aea2b292ac556f0b258... commit 702baeed4b46166aea2b292ac556f0b2589cc8f3 Author: Lena Oden <[email protected]> Date: Mon Apr 25 18:02:36 2016 -0500 Fixes intercom_merge temporal context_id usage This patch fixes a problem in the intecom_merge routine. Intercom_merge needs a temporaly communicator to find the context_id for the merged communicator. However, this communicator also needs a context_id, which is unique on every process and the same on all processes. The problem with the previous routine is that the context_id of an inter-communicator may be used by another communicator – which can be an intra-communicator with a sub-internode communicator. In this case, the context id is not longer unique. A subcommunicator with ID 3 normally is not allowed - so it is allways unique. But we have to make sure that for this communicator, no sub-communicators are created, so we avoid the creation of sub communicators, if the sub communicator flag is set. Signed-off-by: Yanfei Guo <[email protected]> diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c index ded0bb4..305fb9c 100644 --- a/src/mpi/comm/commutil.c +++ b/src/mpi/comm/commutil.c @@ -549,7 +549,8 @@ int MPIR_Comm_commit(MPIR_Comm * comm) MPIR_Comm_map_free(comm); - if (comm->comm_kind == MPIR_COMM_KIND__INTRACOMM) { + if (comm->comm_kind == MPIR_COMM_KIND__INTRACOMM && + !MPIR_CONTEXT_READ_FIELD(SUBCOMM,comm->context_id)) { /*make sure this is not a subcomm*/ mpi_errno = MPIR_Find_local_and_external(comm, &num_local, &local_rank, &local_procs, diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c index 5d01edb..c7283f3 100644 --- a/src/mpi/comm/intercomm_merge.c +++ b/src/mpi/comm/intercomm_merge.c @@ -141,14 +141,20 @@ int MPIR_Intercomm_merge_impl(MPIR_Comm *comm_ptr, int high, MPIR_Comm **new_int new_size = comm_ptr->local_size + comm_ptr->remote_size; - /* FIXME: For the intracomm, we need a consistent context id. + /* For the intracomm, we need a consistent context id. That means that one of the two groups needs to use - the recvcontext_id and the other must use the context_id */ + the recvcontext_id and the other must use the context_id + The recvcontext_id is unique on each process, but another + communicator may use the context_id. Therefore, we do a small hack. + We set both flags indicating a sub-communicator (intra-node and + inter-node) to one. This is normally not possible (a communicator + is either intra- or inter-node) - which makes this context_id unique. */ + if (local_high) { - (*new_intracomm_ptr)->context_id = comm_ptr->recvcontext_id + 2; /* See below */ + (*new_intracomm_ptr)->context_id = MPIR_CONTEXT_SET_FIELD(SUBCOMM,comm_ptr->recvcontext_id, 3); } else { - (*new_intracomm_ptr)->context_id = comm_ptr->context_id + 2; /* See below */ + (*new_intracomm_ptr)->context_id = MPIR_CONTEXT_SET_FIELD(SUBCOMM, comm_ptr->context_id, 3); } (*new_intracomm_ptr)->recvcontext_id = (*new_intracomm_ptr)->context_id; (*new_intracomm_ptr)->remote_size = (*new_intracomm_ptr)->local_size = new_size; ----------------------------------------------------------------------- Summary of changes: src/mpi/comm/commutil.c | 3 ++- src/mpi/comm/intercomm_merge.c | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) hooks/post-receive -- MPICH primary repository