LIKWID
CPU information module

Data type definition for CPU information module in the Lua API

Cpu Info

This structure is returned by getCpuInfo function
It is similar to the C struct CpuInfo

Membername Comment
family Family ID of CPU
model Model ID of CPU
stepping Revision of CPU
clock Base clock frequency
turbo Flag if the system supports the Turbo mode
name Name of the microarchitecture
osname Name of the CPU as given by manufacturer
short_name Short name of microarchitecture
features String with all interesting CPU feature flags as a space separated list
featureFlags Bitmask with all interesting CPU feature flags
Bit positions can be retrieved from the FeatureBit enum
isIntel Flag to check if the system is using Intel CPUs
perf_version Version of architectural performance monitoring capabilities
perf_num_ctr Amount of core-local general-purpose counters
perf_num_fixed_ctr Amount of core-local fixed-purpose counters
perf_width_ctr Register width of core-local counters

Cpu Topology

This structure is returned by getCpuTopology function
The nested list structure is similar to the C struct CpuTopology.

Membername Comment
numHWThreads Total amount of hardware threads in the system
activeHWThreads Amount of active hardware threads in the system
numSockets Number of CPU sockets in the system
numCoresPerSocket Number of physical cores of each socket in the system
numThreadsPerCore Number of hardware threads of each core in the system
numCacheLevels Amount of cache levels in the system
threadPool
(List with
numHWThreads entries)
Membername Comment
threadId Thread ID
coreId ID of physical CPU core
apicId ID of the interrupt line for the hardware thread as defined by ACPI
packageId ID of CPU socket for the current thread
inCpuSet Defines whether the thread is available in current cpuset
cacheLevels
(List with
numCacheLevels entries)
Membername Comment
level Level of cache
associativity Associativity in cache level
sets Sets in cache level
lineSize Size of a cache line in cache level
size Size in bytes of cache level
threads Amount of threads sharing the cache
inclusive Inclusiveness of cache
type
Typename comment
DATACACHE Cache manages only data
INSTRUCTIONCACHE Cache manages only instructions
UNIFIEDCACHE Cache manages data and instructions
ITLB Translation Lookaside Buffer for instruction page addresses
DTLB Translation Lookaside Buffer for data page addresses
NOCACHE Type cannot be determined
topologyTree
Membername Comment
ID ID of socket
Childs
Membername Comment
ID ID of CPU core
Childs List of thread IDs for the current CPU core

Function definitions for Lua CPU information module in the Lua API

getCpuInfo()

Get basic information about the CPUs in the system

Direction Data type(s)
Input Parameter None
Returns Cpu Info lua_cpuinfo

getCpuTopology()

Get the topology information about the CPUs in the system

Direction Data type(s)
Input Parameter None
Return Cpu Topology lua_cputopo

putTopology()

Frees C struct CpuInfo and CpuTopology. You can still use the lua_cpuinfo and lua_cputopo data structures
If you call getCpuInfo or getCpuTopology functions again after calling this function, the topology information will be read again.

Direction Data type(s)
Input Parameter None
Return None

cpustr_to_cpulist(cpuexpression)

Resolve the given CPU expression string to a list of CPUs as available in the system

Direction Data type(s)
Input Parameter
cpuexpression CPU expression string. Look at likwid-pin for possible formats
Return
nrCPUs Number of CPUs in the cpulist
cpulist List containing the CPU IDs after resolution of the cpu expression

printSupportedCPUs()

Print all Intel and AMD CPU types that are supported by Likwid

Direction Data type(s)
Input Parameter None
Return None

*/

/*!