Skip to content

Commit

Permalink
synthetic/export/memory: replace a buggy assertion with some warnings
Browse files Browse the repository at this point in the history
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 <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Apr 14, 2023
1 parent 06373c0 commit 050f532
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions hwloc/topology-synthetic.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2022 Inria. All rights reserved.
* Copyright © 2009-2023 Inria. All rights reserved.
* Copyright © 2009-2010 Université Bordeaux
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
Expand Down Expand Up @@ -1374,11 +1374,22 @@ hwloc__export_synthetic_memory_children(struct hwloc_topology * topology, unsign
* better attaching of things to describe the hierarchy.
*/
hwloc_obj_t numanode = mchild;
/* only export the first NUMA node leaf of each memory child
* FIXME: This assumes mscache aren't shared between nodes, that's true in current platforms
/* only export the first NUMA node leaf of each memory child.
* memcache are ignored. non-first child of memcaches are also ignored.
*/
while (numanode && numanode->type != HWLOC_OBJ_NUMANODE) {
assert(numanode->arity == 1);
if (verbose) {
static int warned = 0;
if (!warned)
fprintf(stderr, "Ignoring memory objects that are not NUMA nodes.\n");
warned = 1;
}
if (verbose && numanode->memory_arity > 1) {
static int warned = 0;
if (!warned)
fprintf(stderr, "Ignoring non-first memory children at non-first level of memory hierarchy.\n");
warned = 1;
}
numanode = numanode->memory_first_child;
}
assert(numanode); /* there's always a numanode at the bottom of the memory tree */
Expand Down

0 comments on commit 050f532

Please sign in to comment.