LIKWID
Macros | Functions
Marker API module

Macros

#define LIKWID_MARKER_CLOSE
 
#define LIKWID_MARKER_GET(regionTag, nevents, events, time, count)
 
#define LIKWID_MARKER_INIT
 
#define LIKWID_MARKER_REGISTER(regionTag)
 
#define LIKWID_MARKER_START(regionTag)
 
#define LIKWID_MARKER_STOP(regionTag)
 
#define LIKWID_MARKER_SWITCH
 
#define LIKWID_MARKER_THREADINIT
 

Functions

int likwid_getProcessorId () __attribute__((visibility("default")))
 Get CPU ID of the current process/thread. More...
 
void likwid_markerClose (void) __attribute__((visibility("default")))
 Close LIKWID's marker API. More...
 
void likwid_markerGetRegion (const char *regionTag, int *nr_events, double *events, double *time, int *count) __attribute__((visibility("default")))
 Get accumulated data of a code region. More...
 
void likwid_markerInit (void) __attribute__((visibility("default")))
 Initialize LIKWID's marker API. More...
 
void likwid_markerNextGroup (void) __attribute__((visibility("default")))
 Select next group to measure. More...
 
int likwid_markerRegisterRegion (const char *regionTag) __attribute__((visibility("default")))
 Register a measurement region. More...
 
int likwid_markerStartRegion (const char *regionTag) __attribute__((visibility("default")))
 Start a measurement region. More...
 
int likwid_markerStopRegion (const char *regionTag) __attribute__((visibility("default")))
 Stop a measurement region. More...
 
void likwid_markerThreadInit (void) __attribute__((visibility("default")))
 Initialize LIKWID's marker API for the current thread. More...
 
int likwid_pinProcess (int processorId) __attribute__((visibility("default")))
 Pin the current process to given CPU. More...
 
int likwid_pinThread (int processorId) __attribute__((visibility("default")))
 Pin the current thread to given CPU. More...
 

Detailed Description

Macro Definition Documentation

#define LIKWID_MARKER_CLOSE

Shortcut for likwid_markerClose() if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

#define LIKWID_MARKER_GET (   regionTag,
  nevents,
  events,
  time,
  count 
)

Shortcut for likwid_markerGetResults() for regionTag if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

#define LIKWID_MARKER_INIT

Shortcut for likwid_markerInit() if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

#define LIKWID_MARKER_REGISTER (   regionTag)

Shortcut for likwid_markerRegisterRegion() with regionTag if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

#define LIKWID_MARKER_START (   regionTag)

Shortcut for likwid_markerStartRegion() with regionTag if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

#define LIKWID_MARKER_STOP (   regionTag)

Shortcut for likwid_markerStopRegion() with regionTag if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

#define LIKWID_MARKER_SWITCH

Shortcut for likwid_markerNextGroup() if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

#define LIKWID_MARKER_THREADINIT

Shortcut for likwid_markerThreadInit() if compiled with -DLIKWID_PERFMON. Otherwise no operation is performed

Function Documentation

int likwid_getProcessorId ( )

Get CPU ID of the current process/thread.

Returns the ID of the CPU the current process or thread is running on.

Returns
current CPU ID
void likwid_markerClose ( void  )

Close LIKWID's marker API.

Must be called in serial region of the application. It gathers all data of regions and writes them out to a file (filepath in env variable LIKWID_FILEPATH).

void likwid_markerGetRegion ( const char *  regionTag,
int *  nr_events,
double *  events,
double *  time,
int *  count 
)

Get accumulated data of a code region.

Get the accumulated data of the current thread for the given regionTag.

Parameters
regionTag[in] Print data using this string
nr_events[in,out] Length of events array
events[out] Events array for the intermediate results
time[out] Accumulated measurement time
count[out] Call count of the code region
void likwid_markerInit ( void  )

Initialize LIKWID's marker API.

Must be called in serial region of the application to set up basic data structures of LIKWID. Reads environment variables:

  • LIKWID_MODE (access mode)
  • LIKWID_MASK (event bitmask)
  • LIKWID_EVENTS (event string)
  • LIKWID_THREADS (cpu list separated by ,)
  • LIKWID_GROUPS (amount of groups)
void likwid_markerNextGroup ( void  )

Select next group to measure.

Must be called in parallel region of the application to switch group on every CPU.

int likwid_markerRegisterRegion ( const char *  regionTag)

Register a measurement region.

Initializes the hashTable entry in order to reduce execution time of likwid_markerStartRegion()

Parameters
regionTag[in] Initialize data using this string
Returns
Error code
int likwid_markerStartRegion ( const char *  regionTag)

Start a measurement region.

Reads the values of all configured counters and saves the results under the name given in regionTag.

Parameters
regionTag[in] Store data using this string
Returns
Error code of start operation
int likwid_markerStopRegion ( const char *  regionTag)

Stop a measurement region.

Reads the values of all configured counters and saves the results under the name given in regionTag. The measurement data of the stopped region gets summed up in global region counters.

Parameters
regionTag[in] Store data using this string
Returns
Error code of stop operation
void likwid_markerThreadInit ( void  )

Initialize LIKWID's marker API for the current thread.

Must be called in parallel region of the application to set up basic data structures of LIKWID. Before you can call likwid_markerThreadInit() you have to call likwid_markerInit().

int likwid_pinProcess ( int  processorId)

Pin the current process to given CPU.

Pin the current process to the given CPU ID. The process cannot be scheduled to another CPU after pinning but the pinning can be changed anytime with this function.

Parameters
[in]processorIdCPU ID to pin the current process to
Returns
error code (1 for success, 0 for error)
int likwid_pinThread ( int  processorId)

Pin the current thread to given CPU.

Pin the current thread to the given CPU ID. The thread cannot be scheduled to another CPU after pinning but the pinning can be changed anytime with this function

Parameters
[in]processorIdCPU ID to pin the current thread to
Returns
error code (1 for success, 0 for error)