Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
doku:papi_ir [2016/07/06 11:31] – [Interfacing with PAPI : High level interface] ir | doku:papi_ir [2016/07/06 12:25] – removed ir | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PAPI ====== | ||
- | < | ||
- | </ | ||
- | ===== Synopsis ===== | ||
- | [[http:// | ||
- | PAPI is an event-based profiling library providing access to hardware performance counters of critical events, e.g., cache misses, number of CYCLES, number of floating point instructions (flpins), or floating point operations per second (FLOPs). These events can be monitored for selected sections of the code allowing for the analysis of the efficiency of mapping the code to the underlying hardware architecture. | ||
- | ==== Types of events ==== | ||
- | **Native events** | ||
- | are countable by the CPU and can such be accessed directly or by the PAPI low-level interface delivering a CPU-specific bit pattern. | ||
- | |||
- | **Preset or predefined events** | ||
- | are software abstractions of architecture-dependent native events that are accessible through the PAPI interface. | ||
- | '' | ||
- | However, due to hardware implementation differences, | ||
- | |||
- | ===== Usage of PAPI ===== | ||
- | The user will have to modify the source code and insert PAPI calls (see below: [[doku: | ||
- | |||
- | | ||
- | | ||
- | and, to compile the user's code while linking the PAPI library ('' | ||
- | gcc my_program.c -lpapi | ||
- | | ||
- | or for Fortran users, | ||
- | | ||
- | | ||
- | |||
- | ==== Interfacing with PAPI : Low level interface ==== | ||
- | In general, some code section to be analyzed with PAPI needs to be wrapped into a sequence of standard PAPI calls, e.g., like in the following examples for | ||
- | * [[doku: | ||
- | * [[doku: | ||
- | As stated in the comment of the C code above, it is best to analyze one particular event at a time. This advice is given because the CPU has limitations in combining arbitrary counters at a time. | ||
- | ==== Interfacing with PAPI : High level interface ==== | ||
- | The high level API combines the counters for a specified list of PAPI preset events, only. The set of implemented high level functions is quite limited and can be found in the section '' | ||
- | The high level API can also be used in conjunction with the low level API. | ||
- | * [[doku: | ||
- | * [[doku: | ||
- | |||
- | ==== Practical tips: ==== | ||
- | * A quick overview of supported events and corresponding PAPI variables for a particular type of CPU is obtained from executing command '' | ||
- | * Measuring the specific event '' | ||
- | * Evaluating floating point performance on Intel ivy bridge: [[https:// | ||
- | * Useful notes on Intel' | ||
- | * Occasionally, | ||
- | |||
- | |||
- | |||