Skip to content

Commit 1783d94

Browse files
committed
ompi/group: fix sparse group proc reference counting
This commit fixes a bug when sparse groups are in use. Since sparse group do not actually increment the reference counts of any procs (they just retain the parent group) it is wrong to decrement the reference counts of all procs in the group using ompi_group_decrement_proc_count(). This commit makes the call to ompi_group_decrement_proc_count() conditional on the group being dense. Fixes #1593 Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 01c90d4 commit 1783d94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ompi/group/group_init.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,11 @@ static void ompi_group_destruct(ompi_group_t *group)
275275
the proc counts are not increased during the constructor,
276276
either). */
277277

278-
ompi_group_decrement_proc_count (group);
278+
#if OMPI_GROUP_SPARSE
279+
if (OMPI_GROUP_IS_DENSE(group))
280+
/* sparse groups do not increment proc reference counters */
281+
#endif
282+
ompi_group_decrement_proc_count (group);
279283

280284
/* release thegrp_proc_pointers memory */
281285
if (NULL != group->grp_proc_pointers) {

0 commit comments

Comments
 (0)