Skip to content

Commit 4bd8185

Browse files
committed
core: don't let hwloc_topology_check() test uninitialized topologies
It's documented as only valid for loaded topology. Return earlier otherwise, but still do some basic topology-independent checks. Refs #622. Signed-off-by: Brice Goglin <[email protected]>
1 parent 549b84f commit 4bd8185

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hwloc/topology.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5224,6 +5224,9 @@ hwloc_topology_check(struct hwloc_topology *topology)
52245224
for(i=HWLOC_OBJ_TYPE_MIN; i<HWLOC_OBJ_TYPE_MAX; i++)
52255225
assert(obj_type_order[obj_order_type[i]] == i);
52265226

5227+
if (topology->state & HWLOC_TOPOLOGY_STATE_IS_INIT)
5228+
return;
5229+
52275230
depth = hwloc_topology_get_depth(topology);
52285231

52295232
assert(!topology->modified);

0 commit comments

Comments
 (0)