Skip to content

Commit f036bac

Browse files
committed
group: Fix ompi_group_have_remote_peers
`ompi_group_t::grp_proc_pointers[i]` may have sentinel values even for processes which reside in the local node because the array for `MPI_COMM_WORLD` is set up before `ompi_proc_complete_init`, which allocates `ompi_proc_t` objects for processes reside in the local node, is called in `MPI_INIT`. So using `ompi_proc_is_sentinel` against `ompi_group_t::grp_proc_pointers[i]` in order to determine whether the process resides in a remote node is not appropriate. This bug sometimes causes an `MPI_ERR_RMA_SHARED` error when `MPI_WIN_ALLOCATE_SHARED` is called, where sm OSC uses `ompi_group_have_remote_peers`. Signed-off-by: KAWASHIMA Takahiro <[email protected]>
1 parent 7ea0595 commit f036bac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ompi/group/group.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,13 @@ bool ompi_group_have_remote_peers (ompi_group_t *group)
563563
#if OMPI_GROUP_SPARSE
564564
proc = ompi_group_peer_lookup (group, i);
565565
#else
566-
if (ompi_proc_is_sentinel (group->grp_proc_pointers[i])) {
566+
proc = ompi_group_get_proc_ptr_raw (group, i);
567+
if (NULL == proc) {
568+
/* the proc must be stored in the group or cached in the proc
569+
* hash table if the process resides in the local node
570+
* (see ompi_proc_complete_init) */
567571
return true;
568572
}
569-
proc = group->grp_proc_pointers[i];
570573
#endif
571574
if (!OPAL_PROC_ON_LOCAL_NODE(proc->super.proc_flags)) {
572575
return true;

0 commit comments

Comments
 (0)