Barrelfish
Macros | Typedefs | Enumerations | Functions | Variables
numa.h File Reference

header specifying the interface of libnuma More...

Macros

#define NUMA_MAX_NUMNODES   16
 < the maximum number of nodes supported More...
 
#define NUMA_NODE_LOCAL   ((nodeid_t)-1)
 error value for the numa node size
 
#define NUMA_NODE_INVALID   ((uintptr_t)-1)
 error value for invalid cores
 

Typedefs

typedef enum numa_policy numa_policy_t
 typedef for the nodemask
 

Enumerations

Functions

errval_t numa_available (void)
 checks if numa support is available More...
 
nodeid_t numa_max_node (void)
 returns the highest node number available on the current system. More...
 
coreid_t numa_max_core (void)
 returns the highest ID of the present cores More...
 
nodeid_t numa_current_node (void)
 returns the current node the domain is running on More...
 
nodeid_t numa_num_possible_nodes (void)
 returns the size of the node mask More...
 
nodeid_t numa_num_configured_nodes (void)
 Obtains the number of all memory nodes in the system. More...
 
struct bitmap * numa_get_mems_allowed (void)
 obtains the nodes the domain is allowed to allocate memory from More...
 
coreid_t numa_num_configured_cpus (void)
 returns the total numberof CPUs in the system More...
 
coreid_t numa_num_task_cpus (void)
 returns the number of cpus that the calling domain is allowed to use. More...
 
nodeid_t numa_num_task_nodes (void)
 returns the number of nodes on which the calling domain is allowed to allocate memory More...
 
errval_t numa_parse_bitmap (char *line, struct bitmap *mask)
 parses line , which is a character string More...
 
struct bitmap * numa_parse_nodestring (char *string)
 parses a character string list of nodes into a bit mask. More...
 
struct bitmap * numa_parse_cpustring (char *string)
 parses a character string list of cpus into a bit mask. More...
 
size_t numa_node_size (nodeid_t node, uintptr_t *freep)
 obtains the size of a node More...
 
lpaddr_t numa_node_base (nodeid_t node)
 obtains the base address of the numa node More...
 
nodeid_t numa_preferred (void)
 returns the preferred node of the current task. More...
 
void numa_set_preferred (nodeid_t node)
 sets the preferred node for the current task to node More...
 
struct bitmap * numa_get_interleave_mask (void)
 returns the current interleave mask More...
 
void numa_set_interleave_mask (struct bitmap *nodemask)
 sets the memory interleave mask for the current task to nodemask More...
 
void numa_bind (struct bitmap *nodemask)
 binds the current task and its children to the nodes specified in nodemask. More...
 
void numa_set_localalloc (void)
 sets the memory allocation policy for the calling task to local allocation.
 
errval_t numa_set_membind (struct bitmap *nodemask)
 sets the memory allocation mask. More...
 
struct bitmap * numa_get_membind (void)
 returns the mask of nodes from which memory can currently be allocated. More...
 
void * numa_alloc_onnode (size_t size, nodeid_t node, size_t pagesize)
 allocates memory on a specific node. More...
 
void * numa_alloc_local (size_t size, size_t pagesize)
 allocates size bytes of memory on the local node More...
 
void * numa_alloc_interleaved (size_t size, size_t pagesize)
 allocates size bytes of memory page interleaved on all nodes. More...
 
void * numa_alloc_interleaved_subset (size_t size, size_t pagesize, struct bitmap *nodemask)
 allocates size bytes of memory page interleaved the nodes specified in the nodemask. More...
 
void * numa_alloc (size_t size, size_t pagesize)
 allocates size bytes of memory with the current NUMA policy. More...
 
void * numa_realloc (void *old_addr, size_t old_size, size_t new_size)
 changes the size of the memory area. More...
 
void numa_free (void *start, size_t size)
 frees size bytes of memory starting at start More...
 
errval_t numa_frame_alloc_on_node (struct capref *dest, size_t size, nodeid_t node, size_t *ret_size)
 allocates a frame on a specific node More...
 
errval_t numa_frame_free (struct capref frame)
 frees a previously allocated frame More...
 
errval_t numa_run_on_node (nodeid_t node)
 runs the current domain on a specific node. More...
 
errval_t numa_run_on_node_mask (struct bitmap *nodemask)
 runs the current domain only on nodes specified in nodemask. More...
 
struct bitmap * numa_get_run_node_mask (void)
 returns a mask of CPUs on which the current task is allowed to run. More...
 
void numa_set_bind_policy (numa_policy_t strict)
 specify the memory bind policy More...
 
void numa_set_strict (numa_policy_t strict)
 enable or disable the strict allocation policy More...
 
uint32_t numa_distance (nodeid_t from, nodeid_t to)
 reports the distance in the machine topology between two nodes More...
 
errval_t numa_sched_getaffinity (domainid_t did, struct bitmap *mask)
 retrieves a bitmask of the cpus on which a domain may run More...
 
errval_t numa_sched_setaffinity (domainid_t did, struct bitmap *mask)
 sets a domain's allowed cpu's to those cpu's specified in mask. More...
 
size_t numa_pagesize (void)
 returns the page size More...
 
errval_t numa_node_to_cpus (nodeid_t node, struct bitmap *mask)
 converts a node number to a bitmask of CPUs More...
 
coreid_t numa_num_node_cpus (nodeid_t node)
 gets the number of cores for the given numa node More...
 
coreid_t numa_node_get_core (nodeid_t node, coreid_t local_core_id)
 gets the system's core ID for a node/local core id configuration More...
 
nodeid_t numa_node_of_cpu (coreid_t cpu)
 returns the node that a cpu belongs to More...
 
struct bitmap * numa_allocate_cpumask (void)
 allocates a bit mask to represent the cores in the system More...
 
void numa_free_cpumask (struct bitmap *cpumask)
 frees a previously allocated CPU bitmask More...
 
struct bitmap * numa_allocate_nodemask (void)
 allocates a bit mask to represent the nodes in the system More...
 
void numa_free_nodemask (struct bitmap *nodemask)
 frees a previously allocated node bitmask More...
 
struct bitmap * numa_bitmask_alloc (unsigned int n)
 allocates a bitmask structure and its associated bit mask More...
 
struct bitmap * numa_bitmask_clearall (struct bitmap *bmp)
 sets all bits in the bit mask to 0. More...
 
struct bitmap * numa_bitmask_clearbit (struct bitmap *bmp, unsigned int n)
 clears the n-th bit of a bitmask More...
 
bool numa_bitmask_equal (const struct bitmap *bmp1, const struct bitmap *bmp2)
 checks if two bitmasks are equal More...
 
void numa_bitmask_free (struct bitmap *bmp)
 frees the memory of a bitmask More...
 
bool numa_bitmask_isbitset (const struct bitmap *bmp, unsigned int n)
 checks if the n-th bit is set in the bitmask More...
 
size_t numa_bitmask_nbytes (struct bitmap *bmp)
 returns the size (in bytes) of the bit mask More...
 
struct bitmap * numa_bitmask_setall (struct bitmap *bmp)
 sets all bits of a bitmask to 1 More...
 
struct bitmap * numa_bitmask_setbit (struct bitmap *bmp, unsigned int n)
 sets the n-th bit of a bitmask to 1 More...
 
void copy_bitmask_to_nodemask (struct bitmap *bmp, nodemask_t *nodemask)
 copies the bitmask to a nodemask More...
 
void copy_nodemask_to_bitmask (nodemask_t *nodemask, struct bitmap *bmp)
 copies the contents of a nodemask into the bitmask More...
 
void copy_bitmask_to_bitmask (struct bitmap *bmpfrom, struct bitmap *bmpto)
 copies one bitmask into another More...
 
uint32_t numa_bitmask_weight (const struct bitmap *bmp)
 returns a count of the bits that are set in the body of the bitmask More...
 
errval_t numa_move_pages (domainid_t did, size_t count, void **pages, const nodeid_t *nodes, errval_t *status, int flags)
 moves a list of pages in the address space of the current domain More...
 
errval_t numa_migrate_pages (domainid_t did, struct bitmap *fromnodes, struct bitmap *tonodes)
 migrate a domain from one set of nodes to another More...
 
void numa_error (char *where)
 
void numa_warn (int number, char *where,...)
 

Variables

struct bitmap * numa_all_nodes_ptr
 bitmask that is allocated by the library with bits representing all nodes on which the calling task may allocate memory.
 
struct bitmap * numa_no_nodes_ptr
 points to a bitmask that is allocated by the library and left all zeroes.
 
struct bitmap * numa_all_cpus_ptr
 points to a bitmask that is allocated by the library with bits representing all cpus on which the calling task may execute.
 

Detailed Description

header specifying the interface of libnuma

This is derived from:

Linux man pages "numa" libnuma from http://oss.sgi.com/projects/libnuma/

Macro Definition Documentation

#define NUMA_MAX_NUMNODES   16

< the maximum number of nodes supported

specify the local node for allocation

Enumeration Type Documentation

Enumerator
NUMA_POLICY_DEFAULT 

default numa policy

NUMA_POLICY_STRICT 

strict numa policy

NUMA_POLICY_PREFERRED 

preferred memory policy

Function Documentation

void copy_bitmask_to_bitmask ( struct bitmap *  bmpfrom,
struct bitmap *  bmpto 
)

copies one bitmask into another

Parameters
bmpfromthe source bitmask
bmptothe destination bitmask

If the two areas differ in size, the copy is truncated to the size of the receiving field or zero-filled.

void copy_bitmask_to_nodemask ( struct bitmap *  bmp,
nodemask_t *  nodemask 
)

copies the bitmask to a nodemask

Parameters
bmpthe bitmask to copy
nodemaskthe destination nodemask

If the two areas differ in size, the copy is truncated to the size of the receiving field or zero-filled.

void copy_nodemask_to_bitmask ( nodemask_t *  nodemask,
struct bitmap *  bmp 
)

copies the contents of a nodemask into the bitmask

Parameters
nodemasknode mask to copy from
bmpbitmap to copy into

If the two areas differ in size, the copy is truncated to the size of the receiving field or zero-filled.

void* numa_alloc ( size_t  size,
size_t  pagesize 
)

allocates size bytes of memory with the current NUMA policy.

Parameters
sizesize of the memory region in bytes
pagesizepage size to be used for the mapping
Returns
pointer to the mapped memory region

The memory must be freed with numa_free(). On errors NULL is returned.

Parameters
sizesize of the memory region in bytes
pagesizepreferred page size to be used
Returns
pointer to the mapped memory region

The memory must be freed with numa_free(). On errors NULL is returned.

void* numa_alloc_interleaved ( size_t  size,
size_t  pagesize 
)

allocates size bytes of memory page interleaved on all nodes.

Parameters
sizesize of the memory region in bytes
pagesizepage size to be used for the mapping
Returns
pointer to the mapped memory region

should only be used for large areas consisting of multiple pages. The memory must be freed with numa_free(). On errors NULL is returned.

Parameters
sizesize of the memory region in bytes
pagesizepreferred page size to be used
Returns
pointer to the mapped memory region

should only be used for large areas consisting of multiple pages. The memory must be freed with numa_free(). On errors NULL is returned.

void* numa_alloc_interleaved_subset ( size_t  size,
size_t  pagesize,
struct bitmap *  nodemask 
)

allocates size bytes of memory page interleaved the nodes specified in the nodemask.

Parameters
sizesize of the memory region in bytes
nodemasksubset of nodes to consider for allocation
pagesizepage size to be used for the mapping
Returns
pointer to the mapped memory region

should only be used for large areas consisting of multiple pages. The memory must be freed with numa_free(). On errors NULL is returned.

Parameters
sizesize of the memory region in bytes
nodemasksubset of nodes to consider for allocation
pagesizepreferred page size to be used
Returns
pointer to the mapped memory region

should only be used for large areas consisting of multiple pages. The memory must be freed with numa_free(). On errors NULL is returned.

void* numa_alloc_local ( size_t  size,
size_t  pagesize 
)

allocates size bytes of memory on the local node

Parameters
sizesize of the memory region in bytes
pagesizepage size to be used for the mapping
Returns
pointer to memory region

The memory must be freed with numa_free(). On errors NULL is returned.

void* numa_alloc_onnode ( size_t  size,
nodeid_t  node,
size_t  pagesize 
)

allocates memory on a specific node.

Parameters
sizesize of the region in bytes
nodeID of the node to allocate from
pagesizepage size to be used for the mapping
Returns
pointer to memory region

The size argument will be rounded up to a multiple of the system page size. if the specified node is externally denied to this process, this call will fail. The memory must be freed with numa_free(). On errors NULL is returned.

struct bitmap* numa_allocate_cpumask ( void  )

allocates a bit mask to represent the cores in the system

Returns
pointer to a new bitmask NULL on failure

allocates a bit mask to represent the cores in the system

Returns
struct bitmap* numa_allocate_nodemask ( void  )

allocates a bit mask to represent the nodes in the system

Returns
pointer to a new bitmask NULL on failure
errval_t numa_available ( void  )

checks if numa support is available

Returns
NUMA_ERR_NOT_AVAILABLE value all other functions are undefined SYS_ERR_OK: NUMA functionality is available

this function must be called before any of the other functions of libnuma. during the call to numa_available the library also gets initialized

void numa_bind ( struct bitmap *  nodemask)

binds the current task and its children to the nodes specified in nodemask.

Parameters
nodemaskbitmap representing the nodes
struct bitmap* numa_bitmask_alloc ( unsigned int  n)

allocates a bitmask structure and its associated bit mask

Parameters
nthe number of bits
Returns
pointer to the bitmask NULL on error
struct bitmap* numa_bitmask_clearall ( struct bitmap *  bmp)

sets all bits in the bit mask to 0.

Parameters
bmppointer to the bitmap
Returns
pointer to the cleared bit map
struct bitmap* numa_bitmask_clearbit ( struct bitmap *  bmp,
unsigned int  n 
)

clears the n-th bit of a bitmask

Parameters
bmpthe bitmask
nthe bit to clear
Returns
pointer to the bitmask
bool numa_bitmask_equal ( const struct bitmap *  bmp1,
const struct bitmap *  bmp2 
)

checks if two bitmasks are equal

Parameters
bmp1bitmask 1
bmp2bitmask 2
Returns
TRUE if the bitmasks are equal FALSE if the are distinct
void numa_bitmask_free ( struct bitmap *  bmp)

frees the memory of a bitmask

Parameters
bmpthe bitmask to be freed
bool numa_bitmask_isbitset ( const struct bitmap *  bmp,
unsigned int  n 
)

checks if the n-th bit is set in the bitmask

Parameters
bmpthe bitmap
nwhich bit to check
Returns
TRUE if the n-th bit is set FALSE otherwise
size_t numa_bitmask_nbytes ( struct bitmap *  bmp)

returns the size (in bytes) of the bit mask

Parameters
bmpthe bitmask
Returns
the size of the memory in bytes rounded up to a multiple of wordsize
struct bitmap* numa_bitmask_setall ( struct bitmap *  bmp)

sets all bits of a bitmask to 1

Parameters
bmpthe bitmask
Returns
the bitmask
struct bitmap* numa_bitmask_setbit ( struct bitmap *  bmp,
unsigned int  n 
)

sets the n-th bit of a bitmask to 1

Parameters
bmpthe bitmask
nwhich bit to activate
Returns
the bitmask
uint32_t numa_bitmask_weight ( const struct bitmap *  bmp)

returns a count of the bits that are set in the body of the bitmask

Parameters
bmpthe bitmask to count the set bits
Returns
number of set bits in this bitmask
nodeid_t numa_current_node ( void  )

returns the current node the domain is running on

Returns
ID of the current node
uint32_t numa_distance ( nodeid_t  from,
nodeid_t  to 
)

reports the distance in the machine topology between two nodes

Parameters
fromsource node to measure the distance
totarget node to measure the distance
Returns
distance between two nodes 0 iff cannot be deterimed

The factors are a multiple of 10. A node has distance 10 to itself.

void numa_error ( char *  where)

is a libnuma internal function that can be overridden by the user program. This function is called with a char * argument when a libnuma function fails. Overriding the library internal definition makes it possible to specify a different error handling strategy when a libnuma function fails. It does not affect numa_available(). The numa_error() function defined in libnuma prints an error on stderr and terminates the program if numa_exit_on_error is set to a non-zero value. The default value of numa_exit_on_error is zero.

Parameters
where
errval_t numa_frame_alloc_on_node ( struct capref dest,
size_t  size,
nodeid_t  node,
size_t *  ret_size 
)

allocates a frame on a specific node

Parameters
destcapref to store the frame
sizesize of the frame to allocated
nodenode on which the frame should be allocated
ret_sizereturned size of the frame capability
Returns
SYS_ERR_OK on SUCCESS errval on FAILURE
errval_t numa_frame_free ( struct capref  frame)

frees a previously allocated frame

Parameters
framecapability to free
void numa_free ( void *  start,
size_t  size 
)

frees size bytes of memory starting at start

Parameters
startstart of the memory region
sizenumber of bytes to free

the memory must be previously allocated by one of the numa_alloc* functions

void numa_free_cpumask ( struct bitmap *  cpumask)

frees a previously allocated CPU bitmask

Parameters
cpumaskpointer to a previously allocated CPU bitmask
void numa_free_nodemask ( struct bitmap *  nodemask)

frees a previously allocated node bitmask

Parameters
nodemaskpointer to a previously allocated node bitmask
struct bitmap* numa_get_interleave_mask ( void  )

returns the current interleave mask

Returns
bitmask representing the current interleave state

returns the current interleave mask if the task's memory allocation policy is page interleaved. Otherwise, this function returns an empty mask.

struct bitmap* numa_get_membind ( void  )

returns the mask of nodes from which memory can currently be allocated.

Returns
bitmap of nodes from which can be allocated
struct bitmap* numa_get_mems_allowed ( void  )

obtains the nodes the domain is allowed to allocate memory from

Returns
bitmask representing the allowing nodes

returns the mask of nodes from which the process is allowed to allocate memory in it's current cpuset context.

struct bitmap* numa_get_run_node_mask ( void  )

returns a mask of CPUs on which the current task is allowed to run.

Returns
bitmap represening the coreids the domain is allowed to run
coreid_t numa_max_core ( void  )

returns the highest ID of the present cores

Returns
the maximum coreID in the system
the maximum number of cores in the system
nodeid_t numa_max_node ( void  )

returns the highest node number available on the current system.

Returns
ID of the max NUMA node
errval_t numa_migrate_pages ( domainid_t  did,
struct bitmap *  fromnodes,
struct bitmap *  tonodes 
)

migrate a domain from one set of nodes to another

Parameters
didthe domain ID
fromnodesbitmap representing the current nodes
tonodesbitmap representing the
Returns
SYS_ERR_OK on SUCCESS
errval_t numa_move_pages ( domainid_t  did,
size_t  count,
void **  pages,
const nodeid_t *  nodes,
errval_t *  status,
int  flags 
)

moves a list of pages in the address space of the current domain

Parameters
didthe domain ID
countnumber of pages to move
pageslist of pages
nodeslist of nodes to which the pages can be moved
statusreturns the outcome for each page
flagsflags for moving the pages
Returns
SYS_ERR_OK on SUCCESS
lpaddr_t numa_node_base ( nodeid_t  node)

obtains the base address of the numa node

Returns
physical address of the start of the numa node
physical address of the start of the numa node NUMA_NODE_INVALID if the node does not exist
coreid_t numa_node_get_core ( nodeid_t  node,
coreid_t  local_core_id 
)

gets the system's core ID for a node/local core id configuration

Parameters
nodeid_t numa_node_of_cpu ( coreid_t  cpu)

returns the node that a cpu belongs to

Parameters
cpuID of the core
Returns
node ID on SUCCESS NUMA_NODE_INVALID on FAILURE
size_t numa_node_size ( nodeid_t  node,
uintptr_t *  freep 
)

obtains the size of a node

Parameters
nodeID of the NUMA node
freep
Returns
size of the node in bytes

returns the memory size of a node. If the argument freep is not NULL, it used to return the amount of free memory on the node. On error it returns NUMA_NODE_INVALIDalias for NUMA node size 64bit variants

Parameters
nodeID of the NUMA node
freepreturns the number of available bytes of the node
Returns
size of the node in bytes

returns the memory size of a node. If the argument freep is not NULL, it used to return the amount of free memory on the node. On error it returns NUMA_NODE_INVALID

errval_t numa_node_to_cpus ( nodeid_t  node,
struct bitmap *  mask 
)

converts a node number to a bitmask of CPUs

Parameters
nodethe ID of the node
maskbitmap representing the CPUs of this node
Returns
SYS_ERR_OK on SUCCESS NUMA_ERR_BITMAP_RANGE on FAILURE (too small bitmap)

The user must pass a bitmask structure with a mask buffer long enough to represent all possible cpu's

coreid_t numa_num_configured_cpus ( void  )

returns the total numberof CPUs in the system

Returns
total number of CPUs in the system

returns the number of cpus in the system. This count includes any cpus that are currently disabled.

nodeid_t numa_num_configured_nodes ( void  )

Obtains the number of all memory nodes in the system.

Returns
number of memory nodes in the system

returns the number of memory nodes in the system. This count includes any nodes that are currently disabled.

coreid_t numa_num_node_cpus ( nodeid_t  node)

gets the number of cores for the given numa node

Parameters
nodeNUMA node to get the number of cores
Returns
number of cores for the node
nodeid_t numa_num_possible_nodes ( void  )

returns the size of the node mask

Returns
size of the node mask
coreid_t numa_num_task_cpus ( void  )

returns the number of cpus that the calling domain is allowed to use.

Returns
number of CPUs the domain is allowed to use
nodeid_t numa_num_task_nodes ( void  )

returns the number of nodes on which the calling domain is allowed to allocate memory

Returns
number of nodes the domain is allowed to use
size_t numa_pagesize ( void  )

returns the page size

Returns
the number of bytes in a page
errval_t numa_parse_bitmap ( char *  line,
struct bitmap *  mask 
)

parses line , which is a character string

Parameters
linecharacter string to parse
maskbitmap to store the result
Returns
SYS_ERR_OK on SUCCESS NUMA_ERR_BITMAP_PARSE on FAILURE

The string contains the hexadecimal representation of a bit map.

XXX according to the man pages this function is only used internally

struct bitmap* numa_parse_cpustring ( char *  string)

parses a character string list of cpus into a bit mask.

Parameters
stringcharacter string to parse
Returns
NUMA bitmask on SUCCESS NULL if the string is invalid

The string is a comma-separated list of cpu numbers or cpu ranges Examples: 1-5,7,10 !4-5 +0-3

struct bitmap* numa_parse_nodestring ( char *  string)

parses a character string list of nodes into a bit mask.

Parameters
stringcharacter string to parse
Returns
NUMA bitmask on SUCCESS NULL if the string is invalid

The string is a comma-separated list of node numbers or node ranges Examples: 1-5,7,10 !4-5 +0-3

If the string length is zero, then the numa_no_nodes_ptr is returned

nodeid_t numa_preferred ( void  )

returns the preferred node of the current task.

Returns
node ID where memory is preferably allocated
void* numa_realloc ( void *  old_addr,
size_t  old_size,
size_t  new_size 
)

changes the size of the memory area.

Parameters
old_addrpointer ot the old memory region
old_sizesize of the old memory region
new_sizenew size to allocate
errval_t numa_run_on_node ( nodeid_t  node)

runs the current domain on a specific node.

Parameters
nodeID of the node to run the domain on
Returns
SYS_ERR_OK on SUCCESS errval on FAILURE

Passing -1 permits the kernel to schedule on all nodes again

errval_t numa_run_on_node_mask ( struct bitmap *  nodemask)

runs the current domain only on nodes specified in nodemask.

Parameters
nodemaskbitmap representing the nodes to run the domain on
Returns
SYS_ERR_OK on SUCCESS errval on FAILURE
errval_t numa_sched_getaffinity ( domainid_t  did,
struct bitmap *  mask 
)

retrieves a bitmask of the cpus on which a domain may run

Parameters
diddomain ID
maskreturned bitmask
Returns
SYS_ERR_OK on success errval on FAILURE
errval_t numa_sched_setaffinity ( domainid_t  did,
struct bitmap *  mask 
)

sets a domain's allowed cpu's to those cpu's specified in mask.

Parameters
diddomain ID
maskbitmap representing the CPUs
Returns
SYS_ERR_OK on success errval on FAILURE
void numa_set_bind_policy ( numa_policy_t  strict)

specify the memory bind policy

Parameters
strictnuma policy to apply

specifies whether calls that bind memory to a specific node should use the preferred policy or a strict policy.

void numa_set_interleave_mask ( struct bitmap *  nodemask)

sets the memory interleave mask for the current task to nodemask

Parameters
nodemaskbitmask representing the nodes

All new memory allocations are page interleaved over all nodes in the interleave mask. Interleaving can be turned off again by passing an empty mask.

This bitmask is considered to be a hint. Fallback to other nodes may be possible

errval_t numa_set_membind ( struct bitmap *  nodemask)

sets the memory allocation mask.

Parameters
nodemaskbitmap representing the nodes

The task will only allocate memory from the nodes set in nodemask.

an empty mask or not allowed nodes in the mask will result in an error

void numa_set_preferred ( nodeid_t  node)

sets the preferred node for the current task to node

Parameters
nodeID of the node to set preferred

The system will attempt to allocate memory from the preferred node, but will fall back to other nodes if no memory is available on the the preferred node

Passing a node of -1 argument specifies local allocation

void numa_set_strict ( numa_policy_t  strict)

enable or disable the strict allocation policy

Parameters
strictnuma policy to apply

s a flag that says whether the functions allocating on specific nodes should use a strict policy. Strict means the allocation will fail if the memory cannot be allocated on the target node.

void numa_warn ( int  number,
char *  where,
  ... 
)

is a libnuma internal function that can be also overridden by the user program. It is called to warn the user when a libnuma function encounters a non-fatal error. The default implementation prints a warning to stderr. The first argument is a unique number identifying each warning. After that there is a printf(3)-style format string and a variable number of arguments. numa_warn exits the program when numa_exit_on_warn is set to a non-zero value. The default value of numa_exit_on_warn is zero.

Parameters
number
where