@@ -1465,13 +1465,14 @@ hwloc__group_memory_tiers(hwloc_topology_t topology,
1465
1465
}
1466
1466
1467
1467
enum hwloc_guess_memtiers_flag {
1468
- HWLOC_GUESS_MEMTIERS_FLAG_SPM_IS_HBM = 1 <<0
1468
+ HWLOC_GUESS_MEMTIERS_FLAG_NODE0_IS_DRAM = 1 <<0 ,
1469
+ HWLOC_GUESS_MEMTIERS_FLAG_SPM_IS_HBM = 1 <<1
1469
1470
};
1470
1471
1471
1472
static int
1472
1473
hwloc__guess_dram_hbm_tiers (struct hwloc_memory_tier_s * tier1 ,
1473
1474
struct hwloc_memory_tier_s * tier2 ,
1474
- unsigned long flags __hwloc_attribute_unused )
1475
+ unsigned long flags )
1475
1476
{
1476
1477
struct hwloc_memory_tier_s * tmp ;
1477
1478
@@ -1498,6 +1499,13 @@ hwloc__guess_dram_hbm_tiers(struct hwloc_memory_tier_s *tier1,
1498
1499
}
1499
1500
/* tier2 BW is >2x tier1 */
1500
1501
1502
+ if ((flags & HWLOC_GUESS_MEMTIERS_FLAG_NODE0_IS_DRAM )
1503
+ && hwloc_bitmap_isset (tier2 -> nodeset , 0 )) {
1504
+ /* node0 is not DRAM, and we assume that's not possible */
1505
+ hwloc_debug (" node0 shouldn't have HBM BW\n" );
1506
+ return -1 ;
1507
+ }
1508
+
1501
1509
/* assume tier1 == DRAM and tier2 == HBM */
1502
1510
tier1 -> type = HWLOC_MEMORY_TIER_DRAM ;
1503
1511
tier2 -> type = HWLOC_MEMORY_TIER_HBM ;
@@ -1529,6 +1537,10 @@ hwloc__guess_memory_tiers_types(hwloc_topology_t topology __hwloc_attribute_unus
1529
1537
hwloc_debug ("Assuming SPM-tier is HBM, ignore bandwidth\n" );
1530
1538
flags |= HWLOC_GUESS_MEMTIERS_FLAG_SPM_IS_HBM ;
1531
1539
}
1540
+ if (strstr (env , "node0_is_dram" )) {
1541
+ hwloc_debug ("Assuming node0 is DRAM\n" );
1542
+ flags |= HWLOC_GUESS_MEMTIERS_FLAG_NODE0_IS_DRAM ;
1543
+ }
1532
1544
}
1533
1545
1534
1546
if (nr_tiers == 1 )
@@ -1586,6 +1598,17 @@ hwloc__guess_memory_tiers_types(hwloc_topology_t topology __hwloc_attribute_unus
1586
1598
}
1587
1599
}
1588
1600
1601
+ if (flags & HWLOC_GUESS_MEMTIERS_FLAG_NODE0_IS_DRAM ) {
1602
+ /* force mark node0's tier as DRAM if we couldn't guess it */
1603
+ for (i = 0 ; i < nr_tiers ; i ++ )
1604
+ if (hwloc_bitmap_isset (tiers [i ].nodeset , 0 )
1605
+ && tiers [i ].type == HWLOC_MEMORY_TIER_UNKNOWN ) {
1606
+ hwloc_debug ("Forcing node0 tier to DRAM" );
1607
+ tiers [i ].type = HWLOC_MEMORY_TIER_DRAM ;
1608
+ break ;
1609
+ }
1610
+ }
1611
+
1589
1612
return 0 ;
1590
1613
}
1591
1614
0 commit comments