LIKWID
Functions
CPU string parser module

Functions

int cpustr_to_cpulist (const char *cpustring, int *cpulist, int length) __attribute__((visibility("default")))
 Read CPU selection string and resolve to available CPU numbers. More...
 
int nodestr_to_nodelist (const char *nodestr, int *nodes, int length) __attribute__((visibility("default")))
 Read NUMA node selection string and resolve to available NUMA node numbers. More...
 
int sockstr_to_socklist (const char *sockstr, int *sockets, int length) __attribute__((visibility("default")))
 Read CPU socket selection string and resolve to available CPU socket numbers. More...
 

Detailed Description

Function Documentation

int cpustr_to_cpulist ( const char *  cpustring,
int *  cpulist,
int  length 
)

Read CPU selection string and resolve to available CPU numbers.

Reads the CPU selection string and fills the given list with the CPU numbers defined in the selection string. This function is a interface function for the different selection modes: scatter, expression, logical and physical.

Parameters
[in]cpustringSelection string
[in,out]cpulistList of CPUs
[in]lengthLength of cpulist
Returns
error code (>0 on success for the returned list length, -ERRORCODE on failure)
int nodestr_to_nodelist ( const char *  nodestr,
int *  nodes,
int  length 
)

Read NUMA node selection string and resolve to available NUMA node numbers.

Reads the NUMA node selection string and fills the given list with the NUMA node numbers defined in the selection string.

Parameters
[in]nodestrSelection string
[out]nodesList of available NUMA nodes
[in]lengthLength of NUMA node list
Returns
error code (>0 on success for the returned list length, -ERRORCODE on failure)
int sockstr_to_socklist ( const char *  sockstr,
int *  sockets,
int  length 
)

Read CPU socket selection string and resolve to available CPU socket numbers.

Reads the CPU socket selection string and fills the given list with the CPU socket numbers defined in the selection string.

Parameters
[in]sockstrSelection string
[out]socketsList of available CPU sockets
[in]lengthLength of CPU socket list
Returns
error code (>0 on success for the returned list length, -ERRORCODE on failure)