dev:debugging
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:debugging [2014/05/10 07:16] – created debug info page vondele | dev:debugging [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 27: | Line 27: | ||
===== valgrind ===== | ===== valgrind ===== | ||
+ | ==== undefined variables ==== | ||
[[ http:// | [[ http:// | ||
Line 52: | Line 53: | ||
Run valgrind with | Run valgrind with | ||
< | < | ||
- | valgrind --max-stackframe=2100192 | + | valgrind --max-stackframe=2100192 --leak-check=full --track-origins=yes |
</ | </ | ||
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. | ||
+ | |||
+ | |||
+ | ==== understanding memory usage ==== | ||
+ | |||
+ | valgrind also comes with the ' | ||
+ | |||
+ | Rather easy with | ||
+ | |||
+ | < | ||
+ | valgrind --tool=massif ../ | ||
+ | ms_print massif.out.XYZ | ||
+ | </ | ||
+ | |||
+ | The valgrind homepage has [[http:// | ||
+ | |||
+ | ==== valgrind in parallel ==== | ||
+ | |||
+ | valgrind can also be used for debugging parallel code, eg.: | ||
+ | |||
+ | < | ||
+ | mpirun -np 2 -x OMP_NUM_THREADS=2 | ||
+ | </ | ||
===== Memory leak checking ===== | ===== Memory leak checking ===== | ||
Line 68: | Line 91: | ||
for the format of the file see [[ https:// | for the format of the file see [[ https:// | ||
+ | ===== Compiler warnings ===== | ||
+ | Unfortunately is the GNU Fortran compiler not on the same level concerning warnings as its C/C++ counterparts. Especially the '' | ||
+ | < | ||
+ | attention : ‘arr.offset’ may be used uninitialized in this function [-Wuninitialized] | ||
+ | attention : ‘arr.dim[1].stride’ may be used uninitialized in this function [-Wuninitialized] | ||
+ | attention : ‘arr.dim[0].ubound’ may be used uninitialized in this function [-Wuninitialized] | ||
+ | </ | ||
- | + | This is tracked at GNU/ | |
- | + | ||
- | + | ||
dev/debugging.1399706185.txt.gz · Last modified: 2020/08/21 10:14 (external edit)