@@ -1383,31 +1383,39 @@ bool PCM::discoverSystemTopology()
1383
1383
1384
1384
void PCM::printSystemTopology () const
1385
1385
{
1386
- if (num_cores == num_online_cores && hybrid == false )
1386
+ const bool all_cores_online_no_hybrid = (num_cores == num_online_cores && hybrid == false );
1387
+
1388
+ if (all_cores_online_no_hybrid)
1387
1389
{
1388
1390
std::cerr << " Number of physical cores: " << (num_cores/threads_per_core) << " \n " ;
1389
1391
}
1390
1392
1391
1393
std::cerr << " Number of logical cores: " << num_cores << " \n " ;
1392
1394
std::cerr << " Number of online logical cores: " << num_online_cores << " \n " ;
1393
1395
1394
- if (num_cores == num_online_cores && hybrid == false )
1396
+ if (all_cores_online_no_hybrid )
1395
1397
{
1396
1398
std::cerr << " Threads (logical cores) per physical core: " << threads_per_core << " \n " ;
1397
1399
}
1398
1400
else
1399
1401
{
1402
+ std::cerr << " Threads (logical cores) per physical core: " << threads_per_core << " (maybe imprecise due to core offlining/hybrid CPU)\n " ;
1400
1403
std::cerr << " Offlined cores: " ;
1401
1404
for (int i = 0 ; i < (int )num_cores; ++i)
1402
1405
if (isCoreOnline ((int32)i) == false )
1403
1406
std::cerr << i << " " ;
1404
1407
std::cerr << " \n " ;
1405
1408
}
1406
1409
std::cerr << " Num sockets: " << num_sockets << " \n " ;
1407
- if (num_phys_cores_per_socket > 0 && hybrid == false )
1410
+ if (all_cores_online_no_hybrid )
1408
1411
{
1409
1412
std::cerr << " Physical cores per socket: " << num_phys_cores_per_socket << " \n " ;
1410
1413
}
1414
+ else
1415
+ {
1416
+ std::cerr << " Physical cores per socket: " << num_cores / num_sockets / threads_per_core << " (maybe imprecise due to core offlining/hybrid CPU)\n " ;
1417
+ }
1418
+
1411
1419
if (hybrid == false )
1412
1420
{
1413
1421
std::cerr << " Last level cache slices per socket: " << getMaxNumOfCBoxes () << " \n " ;
@@ -2218,10 +2226,11 @@ void PCM::printDetailedSystemTopology()
2218
2226
std::cerr << " \n ===== Processor topology =====\n " ;
2219
2227
std::cerr << " OS_Processor Thread_Id Core_Id Tile_Id Package_Id Core_Type Native_CPU_Model\n " ;
2220
2228
std::map<uint32, std::vector<uint32> > os_id_by_core, os_id_by_tile, core_id_by_socket;
2229
+ size_t counter = 0 ;
2221
2230
for (auto it = topology.begin (); it != topology.end (); ++it)
2222
2231
{
2223
2232
std::cerr << std::left << std::setfill (' ' )
2224
- << std::setw (16 ) << it->os_id
2233
+ << std::setw (16 ) << (( it->os_id >= 0 ) ? it-> os_id : counter)
2225
2234
<< std::setw (16 ) << it->thread_id
2226
2235
<< std::setw (16 ) << it->core_id
2227
2236
<< std::setw (16 ) << it->tile_id
@@ -2235,6 +2244,8 @@ void PCM::printDetailedSystemTopology()
2235
2244
// add socket offset to distinguish cores and tiles from different sockets
2236
2245
os_id_by_core[(it->socket << 15 ) + it->core_id ].push_back (it->os_id );
2237
2246
os_id_by_tile[(it->socket << 15 ) + it->tile_id ].push_back (it->os_id );
2247
+
2248
+ ++counter;
2238
2249
}
2239
2250
std::cerr << " ===== Placement on packages =====\n " ;
2240
2251
std::cerr << " Package Id. Core Id. Processors\n " ;
0 commit comments