@@ -1336,16 +1336,26 @@ hwloc__export_synthetic_memory_children(struct hwloc_topology * topology, unsign
1336
1336
}
1337
1337
1338
1338
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 */
1342
1352
1343
1353
if (needprefix )
1344
1354
hwloc__export_synthetic_add_char (& ret , & tmp , & tmplen , ' ' );
1345
1355
1346
1356
hwloc__export_synthetic_add_char (& ret , & tmp , & tmplen , '[' );
1347
1357
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 );
1349
1359
if (hwloc__export_synthetic_update_status (& ret , & tmp , & tmplen , res ) < 0 )
1350
1360
return -1 ;
1351
1361
@@ -1379,9 +1389,8 @@ hwloc_check_memory_symmetric(struct hwloc_topology * topology)
1379
1389
assert (node );
1380
1390
1381
1391
first_parent = node -> parent ;
1382
- assert (hwloc__obj_type_is_normal (first_parent -> type )); /* only depth-1 memory children for now */
1383
1392
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 */
1385
1394
for (i = 0 ; i < hwloc_get_nbobjs_by_depth (topology , first_parent -> depth ); i ++ ) {
1386
1395
hwloc_obj_t parent , mchild ;
1387
1396
@@ -1392,10 +1401,9 @@ hwloc_check_memory_symmetric(struct hwloc_topology * topology)
1392
1401
if (parent -> memory_arity != first_parent -> memory_arity )
1393
1402
goto out_with_bitmap ;
1394
1403
1395
- /* clear these NUMA children from remaining_nodes */
1404
+ /* clear children NUMA bits from remaining_nodes */
1396
1405
mchild = parent -> memory_first_child ;
1397
1406
while (mchild ) {
1398
- assert (mchild -> type == HWLOC_OBJ_NUMANODE ); /* only NUMA node memory children for now */
1399
1407
hwloc_bitmap_clr (remaining_nodes , mchild -> os_index ); /* cannot use parent->nodeset, some normal children may have other NUMA nodes */
1400
1408
mchild = mchild -> next_sibling ;
1401
1409
}
0 commit comments