Skip to content

Commit 44f0a4d

Browse files
committed
synthetic: ignore memory-side caches during export for now
The import-side would require quite a lot of work. Signed-off-by: Brice Goglin <[email protected]>
1 parent c1a7491 commit 44f0a4d

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

hwloc/topology-synthetic.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,16 +1336,26 @@ hwloc__export_synthetic_memory_children(struct hwloc_topology * topology, unsign
13361336
}
13371337

13381338
while (mchild) {
1339-
/* v2: export all NUMA children */
1340-
1341-
assert(mchild->type == HWLOC_OBJ_NUMANODE); /* only NUMA node memory children for now */
1339+
/* FIXME: really recurse to export memcaches and numanode,
1340+
* but it requires clever parsing of [ memcache [numa] [numa] ] during import,
1341+
* better attaching of things to describe the hierarchy.
1342+
*/
1343+
hwloc_obj_t numanode = mchild;
1344+
/* only export the first NUMA node leaf of each memory child
1345+
* FIXME: This assumes mscache aren't shared between nodes, that's true in current platforms
1346+
*/
1347+
while (numanode && numanode->type != HWLOC_OBJ_NUMANODE) {
1348+
assert(numanode->arity == 1);
1349+
numanode = numanode->memory_first_child;
1350+
}
1351+
assert(numanode); /* there's always a numanode at the bottom of the memory tree */
13421352

13431353
if (needprefix)
13441354
hwloc__export_synthetic_add_char(&ret, &tmp, &tmplen, ' ');
13451355

13461356
hwloc__export_synthetic_add_char(&ret, &tmp, &tmplen, '[');
13471357

1348-
res = hwloc__export_synthetic_obj(topology, flags, mchild, (unsigned)-1, tmp, tmplen);
1358+
res = hwloc__export_synthetic_obj(topology, flags, numanode, (unsigned)-1, tmp, tmplen);
13491359
if (hwloc__export_synthetic_update_status(&ret, &tmp, &tmplen, res) < 0)
13501360
return -1;
13511361

@@ -1379,9 +1389,8 @@ hwloc_check_memory_symmetric(struct hwloc_topology * topology)
13791389
assert(node);
13801390

13811391
first_parent = node->parent;
1382-
assert(hwloc__obj_type_is_normal(first_parent->type)); /* only depth-1 memory children for now */
13831392

1384-
/* check whether all object on parent's level have same number of NUMA children */
1393+
/* check whether all object on parent's level have same number of NUMA bits */
13851394
for(i=0; i<hwloc_get_nbobjs_by_depth(topology, first_parent->depth); i++) {
13861395
hwloc_obj_t parent, mchild;
13871396

@@ -1392,10 +1401,9 @@ hwloc_check_memory_symmetric(struct hwloc_topology * topology)
13921401
if (parent->memory_arity != first_parent->memory_arity)
13931402
goto out_with_bitmap;
13941403

1395-
/* clear these NUMA children from remaining_nodes */
1404+
/* clear children NUMA bits from remaining_nodes */
13961405
mchild = parent->memory_first_child;
13971406
while (mchild) {
1398-
assert(mchild->type == HWLOC_OBJ_NUMANODE); /* only NUMA node memory children for now */
13991407
hwloc_bitmap_clr(remaining_nodes, mchild->os_index); /* cannot use parent->nodeset, some normal children may have other NUMA nodes */
14001408
mchild = mchild->next_sibling;
14011409
}

0 commit comments

Comments
 (0)