Intel® MPI Library User's Guide for Linux* OS
Use the following command to launch the GDB* debugger with Intel® MPI Library:
$ mpirun -gdb -n 4 ./testc
You can work with the GDB debugger as you usually do with a single-process application. For details about how to work with parallel programs, see the GDB documentation at http://www.gnu.org/software/gdb/.
You can also attach to a running job with
$ mpirun –n 4 -gdba <pid>
Where <pid> is the process ID for the running MPI rank.