|
NUMA++ 0.11.0
|
Create CPU affinity and apply to current thread. More...
#include <numapp/cpuaffinity.hpp>
Public Member Functions | |
| CpuAffinity (Cpumask &&mask) noexcept | |
| Create affinity from Cpumask. | |
| Cpumask const & | GetMask () const noexcept |
Static Public Member Functions | |
| static CpuAffinity | MakeFromActive () |
| Create current affinity settings. | |
| static CpuAffinity | MakeFromCpuString (char const *cpustring) |
Create CpuAffinity from `cpustring` while considering allowed CPUs from current cpuset. | |
| static CpuAffinity | MakeFromCpuStringAll (char const *cpustring) |
Create CpuAffinity from `cpustring` without considering current cpuset. | |
| static CpuAffinity | MakeBindNode (int node) |
| Create CpuAffinity bound to the specified NUMA node. | |
| static CpuAffinity | MakeBindCpu (int cpu) |
| Create CpuAffinity bound to the specified CPU. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &os, CpuAffinity const &affinity) |
| Formats affinity and inserts it to os. | |
Apply CPU Affinity to Current Thread | |
Applies specified policy to calling thread. | |
| std::error_code | Apply (CpuAffinity const &affinity) noexcept |
| Apply policy to calling thread. | |
Apply CPU Affinity to Specific Thread | |
Applies specified policy to calling thread. | |
| std::error_code | Apply (pid_t thread, CpuAffinity const &affinity) noexcept |
| Apply policy to specified thread. | |
Create CPU affinity and apply to current thread.
For memory policy see numapp::MemPolicy.
Definition at line 87 of file cpuaffinity.hpp.
|
explicitnoexcept |
Create affinity from Cpumask.
| mask | The CPU-mask to use. |
Definition at line 29 of file cpuaffinity.cpp.
|
noexcept |
Definition at line 65 of file cpuaffinity.cpp.
|
staticnodiscard |
Create CpuAffinity bound to the specified CPU.
| std::system_error | on failure. |
Definition at line 59 of file cpuaffinity.cpp.
|
staticnodiscard |
Create CpuAffinity bound to the specified NUMA node.
| std::system_error | on failure. |
Definition at line 51 of file cpuaffinity.cpp.
|
staticnodiscard |
Create current affinity settings.
| std::system_error | on failure. |
Definition at line 35 of file cpuaffinity.cpp.
|
staticnodiscard |
Create CpuAffinity from `cpustring` while considering allowed CPUs from current cpuset.
Example patterns:
1-5,7,10!4-5+0-3allc.f. numa_parse_cpustring for how the format is specified.
| cpustring | CPUs to include such as 1-5,7,10 or all. |
| std::system_error | on failure. Method will fail if cpustring references a CPU outside current cpuset. Use MakeFromCpuStringAll when current cpuset should not be considered. |
Definition at line 43 of file cpuaffinity.cpp.
|
staticnodiscard |
Create CpuAffinity from `cpustring` without considering current cpuset.
Example patterns:
1-5,7,10!4-5+0-3allc.f. numa_parse_cpustring for how the format is specified.
| cpustring | CPUs to include such as 1-5,7,10 or all. |
| std::system_error | on failure. |
Definition at line 47 of file cpuaffinity.cpp.
|
Formats affinity and inserts it to os.
| os | output stream to insert into. |
| affinity | CPU affinity to format. |
Definition at line 69 of file cpuaffinity.cpp.