GDB

From HCL
Revision as of 19:02, 30 January 2012 by Davepc (talk | contribs)

Jump to: navigation, search

Debugging with GDB

compile programme with -g -o0 (or ./configure --enable-debug)

For serial programme (or MPI running with 1 process)

gdb ./programme_name

To debug MPI application in parallel add this line to somewhere in the code:

if (!rank) getc(stdin); MPI_Barrier(MPI_COMM_WORLD);

Then run the code and it will hang on that line.