Skip to content

Debugging a Grappa program

Brandon Myers edited this page Aug 6, 2015 · 2 revisions

(This page is work in progress and not complete)

Run valgrind

Make sure you have a properly built version of valgrind.

With slurm

salloc --nodes=2 --ntasks-per-node=2 mpiexec $(MPI_FLAGS) ./grappa_app.exe

Launch using gdb

With mpirun alone

$ mpirun -np 2 $(MPI_FLAGS) xterm -e gdb ./grappa_app.exe

GDB attach

$ grappa_srun --freeze-on-error --nnode=2 --ppn=2 ./grappa_app.exe
...
...
04: I0806 14:02:23.957942 18656 Grappa.cpp:234] n10:18656 freezing for debugger. Set freeze_flag=false to continue.

# In another terminal
$ ssh n10
$ gdb attach 18656

# GDB macros

(TODO)