LIKWID

Tools

Likwid contains several tools, we include the ones which are typically used when analyzing performance:

  • likwid-topology: Show the thread and cache topology
  • likwid-perfctr: Measure hardware performance counters on Intel and AMD processors
  • likwid-mpirun : Script enabling simple and flexible pinning of MPI and MPI/threaded hybrid applications. With integrated likwid-perfctr support.
  • likwid-pin: Pin your threaded application without touching your code (supports pthreads, Intel OpenMP and gcc OpenMP)
  • likwid-perfscope : Tool to perform live plotting of performance data using gnuplot.

The complete list of available tools is here.

Example on how to use.

  1. Check the available versions of likwid and load preferably the latest version. For example in CoolMUC2:  

    module av likwid 
    module add likwid/5.2.0-gcc8
  2. Choose the performance group you would like to use 

    likwid-perfctr -a
  3. If you are not aware of the topology of our systems you may want to check it with likwid-topology in order to choose the domains/placement of your mpi tasks.
  4. If you want to analyze certain regions of your code, you may want to instrument your code. Please check this documentation. In this case use the wrapper mode (Option -m). You will need to compile with

    $(LIKWID_INC) -DLIKWID_PERFMON

    and link to

    $(LIKWID_LIB) -llikwid
  5. When using OpenMP, you may consider using the skip option (Bitmask with threads to skip) with 

    -s 0x0

    to pin your threads.

  6. Run your code with likwid-mpirun. Here are some examples:

The likwid-mpirun works when using arguments for pinning. Here is an example that uses pinning:

likwid-mpirun -np 32 -nperdomain S:8 -g CLOCK ./myexecutable

This command pins 8 tasks per socket.


likwid-mpirun -np 56 -nperdomain S:14 -g ENERGY -m ./myexecutable 10

This command pins 14 tasks per socket (requires 4 sockets, i.e. 2 Nodes) and is using an instrumented code (see point 4 in this documentation).


Further information