-
Notifications
You must be signed in to change notification settings - Fork 230
TutorialMarkerF90
The Marker API consists of a bunch of function calls and defines that enable the measuring of code regions to get a better insight of the system's activities executing the code region. In scientific programming the interesting code regions are often calculation loops.
The instrumentation is done inside your application but the setup of the performance counters is performed by likwid-perfctr. After the application run, the results are evaluated by likwid-perfctr.
Notice: Please be aware that building of the Fortran 90 module with compiler setting GCC
in config.mk
requires the Intel® Fortran compiler. You can change this in the file make/include_GCC.mk
with the variables FC
and FCFLAGS
.
The functions are defined by the Fortran module likwid.mod
. In contrast to the C/C++ Marker API, there are no defines that can be switched on and off at compile time.
-
likwid_markerInit()
Initialize the Marker API and read the configured eventsets from the environment -
likwid_markerThreadInit()
Add thread to the Marker API and pin application thread (commonly only required if not pthread based threading) -
likwid_markerRegisterRegion(character(*) tag)
Register a region nametag
to the Marker API. This creates an entry in the internally used hash table to minimize overhead at the start of the named region. This call is optional, the same operations are done by start if not registered previously. -
likwid_markerStartRegion(character(*) tag)
Start a named region identified bytag
. This reads the counters are stores the values in the thread's hash table. If the hash table entrytag
does not exist, it is created. -
likwid_markerStopRegion(character(*) tag)
Stop a named region identified bytag
. This reads the counters are stores the values in the thread's hash table. It is assumed that a STOP can only follow a START, hence no existence check of the hash table entry is performed. -
likwid_markerGetRegion(character(*) tag, INTEGER nevents, DOUBLE PRECISION, DIMENSION(*) events, DOUBLE PRECISION time, INTEGER count )
If you want to process a code regions measurement results in the instrumented application itself, you can call this function to get the intermediate results. The region is identified bytag
. Thenevents
parameter is used to specify the length of theevents
array. After the function returns,nevents
is the number of events filled in theevents
array. The aggregated measurement time is returned intime
and the amount of measurements is returned incount
. -
likwid_markerNextGroup()
Switch to the next eventset. If only a single eventset is given, the function performs no operation. If multiple eventsets are configured, this function switches through the eventsets in a round-robin fashion.
Notice: This function creates the biggest overhead of all Marker API functions as it has to setup the register to the next eventset. -
likwid_markerClose()
Finalize the Marker API and write the aggregated results of all regions to a file that is picked up by likwid-perfctr for evaulation.
The instrumentation is done similar to the C/C++ Marker API. An example of the Fortran90 Marker API can be found here: https://github.com/RRZE-HPC/likwid/blob/master/examples/F-markerAPI.F90
The building of the instrumented application is similar to the C/C++ Marker API. Sure, the Fortran90 Marker API only works if LIKWID was built with FORTRAN_INTERFACE = true
in the config.mk
file. The Fortran90 module is installed to the include path. Determine the paths:
$ /bin/bash -c "echo LIKWID_LIB=$(dirname $(which likwid-perfctr))/../lib/"
$ /bin/bash -c "echo LIKWID_INCLUDE=$(dirname $(which likwid-perfctr))/../include/"
After we have the paths, we can build the application:
$ gfortran -fopenmp -I$(LIKWID_INCLUDE) -L$(LIKWID_LIB) <SRC> -o <EXEC> -llikwid
After that we can run our application in the same way we did it for the C/C++ Marker API.
$ likwid-perfctr -C S0:0-3 -g L3 -m <EXEC>
-
Applications
-
Config files
-
Daemons
-
Architectures
- Available counter options
- AMD
- Intel
- Intel Atom
- Intel Pentium M
- Intel Core2
- Intel Nehalem
- Intel NehalemEX
- Intel Westmere
- Intel WestmereEX
- Intel Xeon Phi (KNC)
- Intel Silvermont & Airmont
- Intel Goldmont
- Intel SandyBridge
- Intel SandyBridge EP/EN
- Intel IvyBridge
- Intel IvyBridge EP/EN/EX
- Intel Haswell
- Intel Haswell EP/EN/EX
- Intel Broadwell
- Intel Broadwell D
- Intel Broadwell EP
- Intel Skylake
- Intel Coffeelake
- Intel Kabylake
- Intel Xeon Phi (KNL)
- Intel Skylake X
- Intel Cascadelake SP/AP
- Intel Tigerlake
- Intel Icelake
- Intel Icelake X
- Intel SappireRapids
- Intel GraniteRapids
- Intel SierraForrest
- ARM
- POWER
-
Tutorials
-
Miscellaneous
-
Contributing