Profiling and Debugging

This section provides information and instructions for profiling and debugging your jobs and code using various tools and software. Profiling tools help you understand how much resources are consumed during run time. This can be time, memory, or MPI communication. One main goal is to understand in which parts of your code most time is spent. Depending on the profiler and the applied methods, profiles can be gathered on basis of functions, loops within functions, or source code lines. Profiling information is important for optimising code, as it enables you to focus your efforts on improving the parts of the code that will result in the biggest gains in performance. During a optimisation process profiling will be used regularly to monitor the behaviour and change in behaviour of the code. Therefore, it is advisable to have a representative but reasonable short test case. It should trigger all the desired features of the code. But keep in mind that with a reduced run time (e.g. fewer iterations) other parts of the code could become more dominant (e.g. initialisation phase). Furthermore, due to possible overhead from the profiling tool, the code could run slower than normal. Slurm profiling is language agnostic, high level understanding of how code behaves. MAP is easy to use, works for C/C++, Fortran, Python, GPUs, gives a relatively high level view of code performance not huge amounts of detail (NeSI have a limited number of licences). VTune can profile same languages as MAP (see section to the Julia support page).