Skip to content

Commit 9d0d8bb

Browse files
committed
utils: fix overzealous assertions when searching for objects
Fix the assertions added in 5e308ab, should have been actual ignoring. Signed-off-by: Brice Goglin <[email protected]>
1 parent c8f524e commit 9d0d8bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

utils/hwloc/hwloc-calc.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ hwloc_calc_get_nbobjs_inside_sets_by_depth(hwloc_topology_t topology,
8181
continue;
8282
if (!hwloc_bitmap_isincluded(obj->nodeset, nodeset))
8383
continue;
84-
assert(!hwloc_bitmap_iszero(obj->cpuset) || !hwloc_bitmap_iszero(obj->nodeset));
84+
if (hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_iszero(obj->nodeset))
85+
/* ignore objects with empty sets (both can be empty when outside of cgroup) */
86+
continue;
8587
n++;
8688
}
8789
return n;
@@ -99,7 +101,9 @@ hwloc_calc_get_obj_inside_sets_by_depth(hwloc_topology_t topology,
99101
continue;
100102
if (!hwloc_bitmap_isincluded(obj->nodeset, nodeset))
101103
continue;
102-
assert(!hwloc_bitmap_iszero(obj->cpuset) || !hwloc_bitmap_iszero(obj->nodeset));
104+
if (hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_iszero(obj->nodeset))
105+
/* ignore objects with empty sets (both can be empty when outside of cgroup) */
106+
continue;
103107
if (logical) {
104108
if (i == ind)
105109
return obj;

0 commit comments

Comments
 (0)