valgrind

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
valgrind [2016/10/26 10:50]
meesters [Things to consider when using Valgrind]
valgrind [2018/01/08 14:51]
meesters [An example with visualization]
Line 11: Line 11:
 ===== On Mogon ===== ===== On Mogon =====
  
-On Mogon, valgrind is compiled on the a*-nodes and available as the module ''software/valgrind/3.11.0''((as of 21. Oct. 2016)).+On Mogon, valgrind is compiled on the a*-nodes and available as the module ''debugger/Valgrind/<version>-<toolchain>''.
  
 ===== Things to consider when using Valgrind ===== ===== Things to consider when using Valgrind =====
Line 29: Line 29:
 Imaging you submit a job like: Imaging you submit a job like:
 <code bash> <code bash>
- bsub -n 1 -app Reserve1800M -q short -300 valgrind --tool=callgrind cmd [args]+ srun -p short -A <your account> -n 1 --mem 1800M -300 valgrind [other valgrind args] --tool=callgrind <path/to/cmd[args]
 </code> </code>
 where ''cmd'' is the program to profile with its optional arguments (''args''). where ''cmd'' is the program to profile with its optional arguments (''args'').
  
-This will produce an output file (e.g. ''callgrind.out.44289'') which you can further analyze on the command line:+This will produce an output file (e.g. ''callgrind.out.44289'', with 44289 being the PID of the process) which you can further analyze on the command line:
 <code bash> <code bash>
 callgrind_annotate --auto=yes callgrind.out.44289 |less callgrind_annotate --auto=yes callgrind.out.44289 |less
Line 43: Line 43:
 </code> </code>
  
-giving results like {{ :kcachgrind.png?200 |}} (displaying a function with obvious potential for improvements.+giving results like {{ :kcachgrind.png?200 |}} (displaying a function with obvious potential for improvements).