Skip to content

Commit

Permalink
fixes for pr 3329
Browse files Browse the repository at this point in the history
PR 3329 introduced a regression which causes Open MPI's
MPI_Intercomm_from_groups method to fail.

Related to open-mpi/ompi#12449

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit 213956c)
  • Loading branch information
hppritcha authored and rhc54 committed Apr 4, 2024
1 parent 33e9346 commit 4367d73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client/pmix_client_group.c
Expand Up @@ -1138,6 +1138,7 @@ static void construct_cbfunc(struct pmix_peer_t *pr,
gotctxid = true;
}


/* since the group construction has finished, we can add
* the group to out list of groups. Always sort the
* the array to maintain the same view across participants.*/
Expand All @@ -1153,12 +1154,16 @@ static void construct_cbfunc(struct pmix_peer_t *pr,
darray.type = PMIX_PROC;
++ninfo;

++ninfo; // account for the grpID

if (gotctxid) {
++ninfo;
}

PMIX_INFO_CREATE(iptr, ninfo);
n = 0;
PMIX_INFO_LOAD(&iptr[n], PMIX_GROUP_ID, cb->grpid, PMIX_STRING);
++n;
if (0 < nmembers) {
PMIX_INFO_LOAD(&iptr[n], PMIX_GROUP_MEMBERSHIP, &darray, PMIX_DATA_ARRAY);
// do not destruct darray as the membership is being used
Expand Down
2 changes: 2 additions & 0 deletions src/include/pmix_globals.c
Expand Up @@ -582,9 +582,11 @@ static void grdes(pmix_group_t *p)
{
if (NULL != p->grpid) {
free(p->grpid);
p->grpid = NULL;
}
if (NULL != p->members) {
PMIX_PROC_FREE(p->members, p->nmbrs);
p->members = NULL;
}
}
PMIX_CLASS_INSTANCE(pmix_group_t,
Expand Down

0 comments on commit 4367d73

Please sign in to comment.