Product specifications

Table Of Contents
5–Using QLogic MPI
Debugging MPI Programs
IB6054601-00 H 5-25
A
Debugging MPI Programs
Debugging parallel programs is substantially more difficult than debugging serial
programs. Thoroughly debugging the serial parts of your code before parallelizing
is good programming practice.
MPI Errors
Almost all MPI routines (except MPI_Wtime and MPI_Wtick) return an error
code; either as the function return value in C functions or as the last argument in a
Fortran subroutine call. Before the value is returned, the current MPI error handler
is called. By default, this error handler aborts the MPI job. Therefore, you can get
information about MPI exceptions in your code by providing your own handler for
MPI_ERRORS_RETURN. See the man page for the MPI_Errhandler_set for
details.
See the standard MPI documentation referenced in Appendix G for details on the
MPI error codes.
Using Debuggers
The InfiniPath software supports the use of multiple debuggers, including
pathdb, gdb, and the system call tracing utility strace. These debuggers let you
set breakpoints in a running program, and examine and set its variables.
Symbolic debugging is easier than machine language debugging. To enable
symbolic debugging, you must have compiled with the -g option to mpicc
so that
the compiler will have included symbol tables in the compiled object code.
To run your MPI program with a debugger, use the -debug
or
-debug-no-pause and -debugger options for mpirun. See the man pages to
pathdb, gdb, and strace for details. When running under a debugger, you get
an xterm window on the front end machine for each node process. Therefore, you
can control the different node processes as desired.
To use strace with your MPI program, the syntax is:
$ mpirun -np n -m mpihosts strace program-name
NOTE:
When there are more threads than CPUs, both MPI and OpenMP
performance can be significantly degraded due to over-subscription of the
CPUs.
NOTE:
MPI does not guarantee that an MPI program can continue past an error.