Expand description
System utilities related to compute/processing
Constantsยง
- CORES_
MAX - Maximum number of cores we support; for now limited to bits of our mask integral.
- CORE_
AFFINITY ๐ - Tracks the affinity for this thread. This is updated when affinities are set via our set_affinity() interface.
- MASK_
BITS ๐
Staticsยง
- CORES_
AVAILABLE ๐ - The mask of logical cores available to the process (at startup).
- NODE_
TOPOLOGY ๐ - Stores the mask of logical-core associations on a node/socket. Bits are set for all logical cores within all physical cores of the node.
- SMT_
TOPOLOGY ๐ - Stores the mask of logical-cores with thread/HT/SMT association. Each group here makes up a physical-core.
Functionsยง
- _sys_
path ๐ - available_
parallelism - Get the number of threads which could execute in parallel based on hardware constraints of this system.
- cores_
available - Get the list of cores available. The values were recorded at program start.
- from_
mask ๐ - get_
affinity - Get the core affinity for this thread.
- getcpu
- init_
node_ ๐topology - init_
smt_ ๐topology - into_
mask ๐ - is_
core_ available - Determine if core (by id) is available to the process.
- node_
affinity - Get the cores sharing Node resources relative to id.
- node_
siblings - List the cores sharing Node-tier resources relative to this threads current affinity.
- nth_
core_ available - Gets the ID of the nth core available. This bijects our sequence of cores to actual IDโs which may have gaps for cores which are not available.
- query_
cores_ ๐available - set_
affinity - Set the core affinity for this thread. The ID should be listed in CORES_AVAILABLE. Empty input is a no-op; prior affinity unchanged.
- smt_
affinity - Get the cores sharing SMT resources relative to id.
- smt_
siblings - List the cores sharing SMT-tier resources