Hi Thomas,
Thank you for the patch. It's indeed much more clear to print '-' for offline CPUs.
That does well the job for HWThread enumeration, but there is still a bug for Cache Groups.
if I desactivate cpu 6 (HT of core 2):
Sockets: 1
Cores per socket: 4
Threads per core: 2
--------------------------------------------------------------------------------
HWThread Thread Core Die Socket Available
0 0 0 0 0 *
1 0 1 0 0 *
2 0 2 0 0 *
3 0 3 0 0 *
6 - - - -
7 1 3 0 0 *
--------------------------------------------------------------------------------
Socket 0: ( 0 4 1 5 2 3 7 )
--------------------------------------------------------------------------------
********************************************************************************
Cache Topology
********************************************************************************
Level: 1
Size: 32 kB
Cache groups: ( 0 4 ) ( 1 5 ) ( 2 3 ) ( 7 )
Output prints ( 2 3 ) as sharing the same L1 cache, which is obviously wrong.
The bug is in the Lua code on one side, where ""local threads = cputopo["cacheLevels"][level]["threads"]"" will make the loop to always look for the same number of threads, where ( 2 ) has only one.
On the other side,
in hwloc_init_cacheTopology() :
cachePool[id].threads = likwid_hwloc_record_objs_of_type_below_obj( hwloc_topology, obj, HWLOC_OBJ_PU, NULL, NULL);
will guess from the first Core that all cores have the same thread count.
So, if we deactivate CPU1 (HT of Core 0), if will produce this:
HWThread Thread Core Die Socket Available
0 0 0 0 0 *
1 0 1 0 0 *
2 0 3 0 0 *
3 0 5 0 0 *
4 - - - -
6 1 4 0 0 *
7 1 6 0 0 *
--------------------------------------------------------------------------------
Socket 0: ( 0 1 5 2 6 3 7 )
--------------------------------------------------------------------------------
********************************************************************************
Cache Topology
********************************************************************************
Level: 1
Size: 32 kB
Cache groups: ( 0 ) ( 1 ) ( 5 ) ( 2 ) ( 6 ) ( 3 ) ( 7 )
I do not see any easy way to fix this but to build a dedicated cacheTree as we build a cpuid_topology.topologyTree.
This tree will be then straighforward to handle on the Lua side.
Best,
-- Alexis