Skip to main content

Module compute

Module compute 

Source
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

Type Aliasesยง

Id ๐Ÿ”’
Mask ๐Ÿ”’
Masks ๐Ÿ”’