Skip to content

Commit 050f532

Browse files
committed
synthetic/export/memory: replace a buggy assertion with some warnings
We currently cannot export complex memory hierarchies with memory-side caches, caches are ignored, as well as some non-first NUMA nods below them. Signed-off-by: Brice Goglin <[email protected]>
1 parent 06373c0 commit 050f532

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

hwloc/topology-synthetic.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright © 2009 CNRS
3-
* Copyright © 2009-2022 Inria. All rights reserved.
3+
* Copyright © 2009-2023 Inria. All rights reserved.
44
* Copyright © 2009-2010 Université Bordeaux
55
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
66
* See COPYING in top-level directory.
@@ -1374,11 +1374,22 @@ hwloc__export_synthetic_memory_children(struct hwloc_topology * topology, unsign
13741374
* better attaching of things to describe the hierarchy.
13751375
*/
13761376
hwloc_obj_t numanode = mchild;
1377-
/* only export the first NUMA node leaf of each memory child
1378-
* FIXME: This assumes mscache aren't shared between nodes, that's true in current platforms
1377+
/* only export the first NUMA node leaf of each memory child.
1378+
* memcache are ignored. non-first child of memcaches are also ignored.
13791379
*/
13801380
while (numanode && numanode->type != HWLOC_OBJ_NUMANODE) {
1381-
assert(numanode->arity == 1);
1381+
if (verbose) {
1382+
static int warned = 0;
1383+
if (!warned)
1384+
fprintf(stderr, "Ignoring memory objects that are not NUMA nodes.\n");
1385+
warned = 1;
1386+
}
1387+
if (verbose && numanode->memory_arity > 1) {
1388+
static int warned = 0;
1389+
if (!warned)
1390+
fprintf(stderr, "Ignoring non-first memory children at non-first level of memory hierarchy.\n");
1391+
warned = 1;
1392+
}
13821393
numanode = numanode->memory_first_child;
13831394
}
13841395
assert(numanode); /* there's always a numanode at the bottom of the memory tree */

0 commit comments

Comments
 (0)