From 5427b33caf3191f9e3af7a6cb9e2472556c8af16 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 25 Nov 2014 10:10:56 +0100 Subject: [PATCH] hwloc: debug: fix an overzealous assertion about the parent cpuset vs its children When I/O are attached under a PU, removing the children's cpusets from the parent cpuset doesn't give 0, it gives the PU cpuset. The assertion fails on single-pu machines with I/O when --merge is given, only one PU remains with I/O under it. But if we insert Misc by cpuset under PU, it gives 0 as expected. Fix the assertion accordingly. Thanks to Thomas Van Doren for reporting the issue. (cherry picked from commit open-mpi/hwloc@45c94c336d828210b2e7fe8cfd6c528066567bc5) Signed-off-by: Jeff Squyres --- opal/mca/hwloc/hwloc191/hwloc/src/topology.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/opal/mca/hwloc/hwloc191/hwloc/src/topology.c b/opal/mca/hwloc/hwloc191/hwloc/src/topology.c index 28bf670726..a86f1ffd7a 100644 --- a/opal/mca/hwloc/hwloc191/hwloc/src/topology.c +++ b/opal/mca/hwloc/hwloc191/hwloc/src/topology.c @@ -3035,7 +3035,17 @@ hwloc__check_children(struct hwloc_obj *parent) assert(hwloc_bitmap_isincluded(parent->children[j]->cpuset, remaining_parent_set)); hwloc_bitmap_andnot(remaining_parent_set, remaining_parent_set, parent->children[j]->cpuset); } - assert(hwloc_bitmap_iszero(remaining_parent_set)); + if (parent->type == HWLOC_OBJ_PU) { + /* if parent is a PU, its os_index bit may remain. + * it may be in a Misc child inserted by cpuset, or could be in no child */ + if (hwloc_bitmap_weight(remaining_parent_set) == 1) + assert((unsigned) hwloc_bitmap_first(remaining_parent_set) == parent->os_index); + else + assert(hwloc_bitmap_iszero(remaining_parent_set)); + } else { + /* nothing remains */ + assert(hwloc_bitmap_iszero(remaining_parent_set)); + } hwloc_bitmap_free(remaining_parent_set); }