@@ -1360,7 +1360,7 @@ hwloc__export_synthetic_memory_children(struct hwloc_topology * topology, unsign
1360
1360
1361
1361
if (flags & HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1 ) {
1362
1362
/* v1: export a single NUMA child */
1363
- if (parent -> memory_arity > 1 || mchild -> type != HWLOC_OBJ_NUMANODE ) {
1363
+ if (parent -> memory_arity > 1 ) {
1364
1364
/* not supported */
1365
1365
if (verbose )
1366
1366
fprintf (stderr , "Cannot export to synthetic v1 if multiple memory children are attached to the same location.\n" );
@@ -1371,6 +1371,9 @@ hwloc__export_synthetic_memory_children(struct hwloc_topology * topology, unsign
1371
1371
if (needprefix )
1372
1372
hwloc__export_synthetic_add_char (& ret , & tmp , & tmplen , ' ' );
1373
1373
1374
+ /* ignore memcaches and export the NUMA node */
1375
+ while (mchild -> type != HWLOC_OBJ_NUMANODE )
1376
+ mchild = mchild -> memory_first_child ;
1374
1377
res = hwloc__export_synthetic_obj (topology , flags , mchild , 1 , tmp , tmplen );
1375
1378
if (hwloc__export_synthetic_update_status (& ret , & tmp , & tmplen , res ) < 0 )
1376
1379
return -1 ;
@@ -1531,17 +1534,21 @@ hwloc_topology_export_synthetic(struct hwloc_topology * topology,
1531
1534
1532
1535
if (flags & HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1 ) {
1533
1536
/* v1 requires all NUMA at the same level */
1534
- hwloc_obj_t node ;
1537
+ hwloc_obj_t node , parent ;
1535
1538
signed pdepth ;
1536
1539
1537
1540
node = hwloc_get_obj_by_type (topology , HWLOC_OBJ_NUMANODE , 0 );
1538
1541
assert (node );
1539
- assert (hwloc__obj_type_is_normal (node -> parent -> type )); /* only depth-1 memory children for now */
1540
- pdepth = node -> parent -> depth ;
1542
+ parent = node -> parent ;
1543
+ while (!hwloc__obj_type_is_normal (parent -> type ))
1544
+ parent = parent -> parent ;
1545
+ pdepth = parent -> depth ;
1541
1546
1542
1547
while ((node = node -> next_cousin ) != NULL ) {
1543
- assert (hwloc__obj_type_is_normal (node -> parent -> type )); /* only depth-1 memory children for now */
1544
- if (node -> parent -> depth != pdepth ) {
1548
+ parent = node -> parent ;
1549
+ while (!hwloc__obj_type_is_normal (parent -> type ))
1550
+ parent = parent -> parent ;
1551
+ if (parent -> depth != pdepth ) {
1545
1552
if (verbose )
1546
1553
fprintf (stderr , "Cannot export to synthetic v1 if memory is attached to parents at different depths.\n" );
1547
1554
errno = EINVAL ;
0 commit comments