NUMA++ 0.11.0
Loading...
Searching...
No Matches
numapp::ll Namespace Reference

Defines lowlevel functions that should not be used directly. More...

Functions

std::error_code SetSchedulerPolicy (pid_t pid, int policy, int static_priority, int dynamic_priority) noexcept
 A low-level, and error prone function to set policy.
 
std::error_code GetSchedulerPolicy (pid_t pid, int *policy, int *static_priority, int *dynamic_priority) noexcept
 A low-level, and error prone function to get policy.
 
std::error_code GetCpuAffinity (pid_t ttid, Cpumask &mask) noexcept
 Get CPU affinity.
 
std::error_code SetCpuAffinity (pid_t ttid, Cpumask const &mask) noexcept
 Set CPU affinity.
 
std::error_code NumaNodeToCpumask (int node, Cpumask &mask) noexcept
 Convert NUMA node number to corresponding CPU mask.
 
std::error_code GetMemPolicy (int &mode, Nodemask &mask, void *addr, unsigned flags) noexcept
 Get memory policy for calling thread or an address.
 
std::error_code SetMemPolicy (int mode, Nodemask const &mask) noexcept
 Set active memory policy for calling thread.
 
std::error_code SetMemPolicy (void *addr, std::size_t len, int mode, Nodemask const &mask, unsigned flags) noexcept
 Set memory policy for memory range.
 

Detailed Description

Defines lowlevel functions that should not be used directly.

Function Documentation

◆ GetCpuAffinity()

std::error_code numapp::ll::GetCpuAffinity ( pid_t ttid,
Cpumask & mask )
noexcept

Get CPU affinity.

Parameters
ttidThread id to get the affinity from.
[out]mask
Returns
error code.
Related man-page(s):

◆ GetMemPolicy()

std::error_code numapp::ll::GetMemPolicy ( int & mode,
Nodemask & mask,
void * addr,
unsigned flags )
noexcept

Get memory policy for calling thread or an address.

See manpage for details.

Related man-page(s):
Parameters
[out]modememory policy.
[out]maskThe output nodemask.
[in]addrAddress to get policy for.
[in]flagsDetermines operation.
Returns
errors from get_mempolicy.

◆ GetSchedulerPolicy()

std::error_code numapp::ll::GetSchedulerPolicy ( pid_t pid,
int * policy,
int * static_priority,
int * dynamic_priority )
noexcept

A low-level, and error prone function to get policy.

Prefer to use the numapp::Scheduler instead.

◆ NumaNodeToCpumask()

std::error_code numapp::ll::NumaNodeToCpumask ( int node,
Cpumask & mask )
noexcept

Convert NUMA node number to corresponding CPU mask.

Parameters
nodeNUMA node number to get mask for.
[out]maskDestination CPU mask.

◆ SetCpuAffinity()

std::error_code numapp::ll::SetCpuAffinity ( pid_t ttid,
Cpumask const & mask )
noexcept

Set CPU affinity.

Parameters
ttidThread id to apply the affinity to.
maskCPU mask describing the desired affinity.
Returns
error code.
Related man-page(s):

◆ SetMemPolicy() [1/2]

std::error_code numapp::ll::SetMemPolicy ( int mode,
Nodemask const & mask )
noexcept

Set active memory policy for calling thread.

Parameters
modememory policy.
maskthe input nodemask.
Returns
errors from get_mempolicy.

◆ SetMemPolicy() [2/2]

std::error_code numapp::ll::SetMemPolicy ( void * addr,
std::size_t len,
int mode,
Nodemask const & mask,
unsigned flags )
noexcept

Set memory policy for memory range.

Parameters
addrstarting address.
lenmemory range length.
modememory policy.
maskthe input nodemask.
flagscombination of MPOL_MF_* flags
Returns
errors from mbind.

◆ SetSchedulerPolicy()

std::error_code numapp::ll::SetSchedulerPolicy ( pid_t pid,
int policy,
int static_priority,
int dynamic_priority )
noexcept

A low-level, and error prone function to set policy.

Prefer to use the numapp::Apply() functions instead.