LIKWID
Classes | Typedefs | Functions
Thread affinity module

Classes

struct  AffinityDomain
 The AffinityDomain data structure describes a single domain in the current system. More...
 
struct  AffinityDomains
 The AffinityDomains data structure holds different count variables describing the various system layers. More...
 

Typedefs

typedef AffinityDomainsAffinityDomains_t
 Pointer for exporting the AffinityDomains data structure.
 

Functions

void affinity_finalize () __attribute__((visibility("default")))
 Destroy affinity information structure. More...
 
void affinity_init () __attribute__((visibility("default")))
 Initialize affinity information. More...
 
void affinity_pinProcess (int processorId) __attribute__((visibility("default")))
 Pin process to a CPU. More...
 
void affinity_pinProcesses (int cpu_count, const int *processorIds) __attribute__((visibility("default")))
 Pin processes to a CPU. More...
 
void affinity_pinThread (int processorId) __attribute__((visibility("default")))
 Pin thread to a CPU. More...
 
int affinity_processGetProcessorId () __attribute__((visibility("default")))
 Return the CPU ID where the current process runs. More...
 
int affinity_threadGetProcessorId () __attribute__((visibility("default")))
 Return the CPU ID where the current thread runs. More...
 
AffinityDomains_t get_affinityDomains (void) __attribute__((visibility("default")))
 Retrieve affinity structure. More...
 

Detailed Description

Function Documentation

void affinity_finalize ( )

Destroy affinity information structure.

Destroys the affinity information structure AffinityDomains_t. Retrieved pointers to the structures are not valid anymore after this function call

See also
AffinityDomains_t
void affinity_init ( )

Initialize affinity information.

Initialize affinity information AffinityDomains_t using the data of the structures CpuInfo_t, CpuTopology_t and NumaTopology_t

See also
AffinityDomains_t
void affinity_pinProcess ( int  processorId)

Pin process to a CPU.

Pin process to a CPU. Duplicate of likwid_pinProcess()

Parameters
[in]processorIdCPU ID for pinning
void affinity_pinProcesses ( int  cpu_count,
const int *  processorIds 
)

Pin processes to a CPU.

Pin processes to a CPU. Creates a cpuset with the given processor IDs

Parameters
[in]cpu_countNumber of processors in processorIds
[in]processorIdsArray of processor IDs
void affinity_pinThread ( int  processorId)

Pin thread to a CPU.

Pin thread to a CPU. Duplicate of likwid_pinThread()

Parameters
[in]processorIdCPU ID for pinning
int affinity_processGetProcessorId ( )

Return the CPU ID where the current process runs.

Returns
CPU ID
int affinity_threadGetProcessorId ( )

Return the CPU ID where the current thread runs.

Returns
CPU ID
AffinityDomains_t get_affinityDomains ( void  )

Retrieve affinity structure.

Get the previously initialized affinity info structure

See also
AffinityDomains_t
Returns
AffinityDomains_t (pointer to internal affinityDomains structure)