debug_quickstart

This is an old revision of the document!

Quick start: Debugging MPI programs on Mogon

This is a greatly shortened version of how to use our debug wrapper selective-debug.
If you aren't familiar with the basics of using a debugger like gdb, you should follow our Tutorial: Debugging MPI programs at Mogon.

This is the procedure for debugging one node from the amount of nodes you've chosen for running your program.
If you want to debug multiple nodes, you should read the section “Debugging multiple nodes at once” of our tutorial.

1. Make the libraries available which are needed for compilation and execution, e.g.
$module purge$ module add gcc/4.7.0
$module add mpi/openmpi/1.6.1/gcc_4.7.0 2. Modify your program by including the “selective-debug1) wrapper and use the BREAKPOINT_AND_SLEEP() macro to halt where appropriate. #include “selective-debug.h” if(my_rank == <rank on which the problem exists>) { BREAKPOINT_AND_SLEEP(10); //delay of 10 seconds, allowing gdb to start up and halt the program } 3. Compile your program with the switch -g 2), e.g. $ mpicc <your program> -g -o <executable program>
bsub -I -n <amount of processes> -q short -a openmpi mpirun ./selective-debug <your program>