Code performance
Optimising and profiling HPC codes is key to performance, and getting the most science per kWhr.
COSMA includes many tools to help with this, and regular training activities related to these.
The SHAREing project also offers a code assessment service allowing users to submit their codes for assessment, so that potential easy performance gains can be identified.
Please fill out the form and submit your code!
The following tools are available on COSMA for profiling/benchmarking/etc.
Here is a summarized table for performance tools:
Tutorial |
Description |
|---|---|
Analyses vectorisation, threading design. |
|
Hotspot analysis, memory access patterns, threading efficiency and I/O. |
|
AMD’s profiling suite. |
|
Command-line tools ( |
|
Google’s lightweight performance analysis tool. |
|
Sampling profiler for Linux that can profile code. |
|
The DDT parallel debugger and MAP profiler for MPI/OpenMP/CUDA codes. |
|
Dynamic analysis tool that detects memory errors and threading errors. |
|
Memcheck tool finds memory errors while Cachegrind/Callgrind profile cache and branch behaviour. |
|
Runtime correctness checker for MPI applications, catching deadlocks, datatype mismatches, resource leaks. |
|
Generates the profiles and OTF2 traces used by tools like Vampir and Scalasca. |
|
Interactive trace-visualisation tool for exploring event traces at any level of detail. |
|
I/O characterisation tool that captures POSIX, MPI-IO and HDF5 I/O behaviours. |
Profiling and debugging tools
Advisor
The Intel Advisor tool analyses vectorization.
Details to follow
Allinea
The Linaro (was Allinea, was ARM) FORGE and MAP tools.
Details to follow
Darshan
Details to follow
gperftools
Details to follow
Inspector
Details to follow
The Intel Inspector tool.
Likwid
Details to follow
Must
Details to follow
Oprofile
Details to follow
Scorep
Details to follow
Uprof
Details to follow
Valgrind
Details to follow
Vampir
Details to follow
Vtune
Details to follow
The Intel Vtune tool
Modules
Tool |
Module |
Commands |
|---|---|---|
Intel Advisor |
|
|
Intel Inspector |
|
|
Intel VTune |
|
|
Linaro Forge |
|
|
Darshan |
|
|
gperftools |
|
|
LIKWID |
|
|
OProfile |
|
|
AMD uProf |
|
|
Vampir |
|
|
likwid needs a compiler module to be loaded first. Newer versions of vtune and advisor become available after loading intel_comp. Score-P and MUST need matching compiler and MPI modules, so use module avail scorep and module avail must to see which.
valgrind, gdb, perf, strace and gstack are installed on the login nodes, with no module to load.
Debugging a crash
Compile with -g, and without heavy optimisation, then run your program under gdb:
gcc -g -O0 myprogram.c -o myprogram
gdb --args ./myprogram myinput
At the (gdb) prompt, type run. When the program crashes, type bt to show where it stopped.
To find memory errors, such as writing past the end of an array:
valgrind --leak-check=full ./myprogram
Core dumps are turned off by default, and are handled by the system when turned on, so running the program under gdb is usually easier.
Measuring performance
For a quick summary of a program’s performance, use perf:
perf stat ./myprogram
For the layout of a node’s sockets, caches and NUMA domains, use likwid-topology. Run these in a job, because results on a login node will not match the compute nodes, which can have a different CPU.
See also MPI hints for pinning, and cjobload for how a running job is using its nodes.