MADNESS 0.10.1
Public Member Functions | Public Attributes | List of all members
madness::ThreadBindingInfo Struct Reference

Description of the CPU affinity of the calling process. More...

#include <thread_binding.h>

Public Member Functions

std::size_t ncpu_allowed () const
 Number of hardware threads this process may run on.
 

Public Attributes

bool available = false
 
std::vector< intcpus
 Logical (hardware thread) ids this process is allowed to run on.
 
int ncpu_configured = 0
 Number of logical CPUs configured on this host (not just allowed).
 
std::vector< intnuma_nodes
 

Detailed Description

Description of the CPU affinity of the calling process.

Filled in by get_thread_binding_info(); all information is obtained from the OS (sched_getaffinity(2) and sysfs), no external library is needed.

Member Function Documentation

◆ ncpu_allowed()

std::size_t madness::ThreadBindingInfo::ncpu_allowed ( ) const
inline

Number of hardware threads this process may run on.

References cpus.

Referenced by madness::check_thread_binding().

Member Data Documentation

◆ available

bool madness::ThreadBindingInfo::available = false

True if the platform exposes CPU affinity (Linux). On macOS, or if the affinity query failed, this is false and all other members are meaningless.

Referenced by madness::check_thread_binding(), and madness::get_thread_binding_info().

◆ cpus

std::vector<int> madness::ThreadBindingInfo::cpus

Logical (hardware thread) ids this process is allowed to run on.

Referenced by madness::check_thread_binding(), madness::get_thread_binding_info(), and ncpu_allowed().

◆ ncpu_configured

int madness::ThreadBindingInfo::ncpu_configured = 0

Number of logical CPUs configured on this host (not just allowed).

Referenced by madness::check_thread_binding(), and madness::get_thread_binding_info().

◆ numa_nodes

std::vector<int> madness::ThreadBindingInfo::numa_nodes

Distinct NUMA nodes spanned by cpus, sorted; empty if the NUMA topology could not be determined.

Referenced by madness::check_thread_binding(), and madness::get_thread_binding_info().


The documentation for this struct was generated from the following file: