diff --git a/ompi/communicator/comm.c b/ompi/communicator/comm.c index 04dfa3308bb..8a75814e89b 100644 --- a/ompi/communicator/comm.c +++ b/ompi/communicator/comm.c @@ -1887,6 +1887,10 @@ int ompi_comm_enable(ompi_communicator_t *old_comm, { int ret = OMPI_SUCCESS; + /* set the rank information before calling nextcid */ + new_comm->c_local_group->grp_my_rank = new_rank; + new_comm->c_my_rank = new_rank; + /* Determine context id. It is identical to f_2_c_handle */ ret = ompi_comm_nextcid (new_comm, old_comm, NULL, NULL, NULL, false, OMPI_COMM_CID_INTRA);