User Tools

Site Tools


dev:debugging

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:debugging [2015/12/18 14:36] – [valgrind] vondeledev:debugging [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 53: Line 53:
 Run valgrind with  Run valgrind with 
 <code> <code>
-valgrind --max-stackframe=2100192  --leak-check=full --track-origins=yes+valgrind --max-stackframe=2100192 --leak-check=full --track-origins=yes
 </code> </code>
 to get the origin of undefined variables in addition to a leak check report. to get the origin of undefined variables in addition to a leak check report.
Line 60: Line 60:
 ==== understanding memory usage ==== ==== understanding memory usage ====
  
-valgrind also comes with the 'massif' tool, which can provide detailed information about memory usage. How much is the peak allocated memory, and where do most of these allocations come from ? +valgrind also comes with the 'massif' tool, which can provide detailed information about memory usage. How much is the peak allocated memory, and where do most of these allocations come from? 
  
 Rather easy with Rather easy with
Line 70: Line 70:
  
 The valgrind homepage has [[http://valgrind.org/docs/manual/ms-manual.html | detailed description of massif]]. The valgrind homepage has [[http://valgrind.org/docs/manual/ms-manual.html | detailed description of massif]].
 +
 +==== valgrind in parallel ====
 +
 +valgrind can also be used for debugging parallel code, eg.:
 +
 +<code>
 +mpirun -np 2 -x OMP_NUM_THREADS=2  valgrind --max-stackframe=2100192 --leak-check=full --track-origins=yes cp2k.psmp cp2k.inp
 +</code>
 +
 ===== Memory leak checking ===== ===== Memory leak checking =====
  
dev/debugging.1450449404.txt.gz · Last modified: 2020/08/21 10:14 (external edit)