Valgrind is an instrumentation framework for building dynamic analysis tools. Valgrind tools can automatically detect many memory management and threading bugs, and profile your programs in detail.
Usage
- The program can be loaded with the command
module load Valgrind/3.19.0-gompi-2022a
. - Your serial code can be checked for memory leaks by changing the execution of your code in the submit script, e.g.
valgrind --log-file=[logfile] [code]
. - Your parallel MPI code can be checked using
mpirun valgrind --log-file=[logfile] [code]
.
Notes
- Note that the execution time of your program with valgrind will be much longer.