![]() |
GHOST
1.1.2
General, Hybrid, and Optimized Sparse Toolkit
|
For performance engineering it is of interest to instrument certain (hot) regions of the source code. Instrumentation can be switched on at compilation time and it affects by default all mathematical kernels in GHOST. The region name will be the name of the kernel, e.g., axpy or spmv. At the moment, instrumentation can be configured to either register a region's runtime or use the Likwid Marker API.
A user may define more regions using the macros GHOST_INSTR_START(tag) and GHOST_INSTR_STOP(tag) where tag is a string with the desired region name.
If a mathematical kernel gets called in different surroundings, only a single region with the kernel name would be created for this kernel. In order to avoid that, the functions ghost_instr_prefix_set() and ghost_instr_suffix_set() can be used to set a specific pre-/suffix string for each surrounding.
For example, in the following code only a single region called dot containing all dot products would be created:
In order to have a separate region for each dot product, the following lines have to be inserted:
Now, two regions (dot_xy and dot_xz) will be created.
In order to get information about instrumented regions using hardware performance monitoring with Likwid, the program binary call has to be wrapped with likwid-perfctr
. For detailed documentation see the Likwid homepage.
likwid-perfctr
.Region-specific timing information is stored in the struct ghost_timing_region. In order to get timing information about a certain region ghost_timing_region_create() is used.
The function ghost_timing_summarystring() can be used for generating a summary string about all measured regions.