The Intel® Debugger (IDB) supports debugging of message passing interface (MPI) applications launched by
mpiexec, an MPI launcher from Intel® MPI 3.0 and later
To start your parallel application under debugger control, you need to have the environment variable IDB_HOME set to the directory that your debugger is in.
When debugging an application launched by mpich, issue the following command at the shell:
% mpirun -dbg=idb -np N [other mpich options] application [application arguments] [-idb idb options]
where N represents number of processes and application is the name of the MPP program you would like to debug.
The debugger is now capable of debugging an MPI job that uses the MPICH or the Intel MPI 3.0 libraries. In addition, it is capable of attaching to an existing MPI job that uses MPICH.
You need to copy the mpirun_dbg.idb script that comes with the debugger's package to the bin directory of your MPICH installation. Also note that the GDB compatibility mode is now available for debugging the MPI applications. For information how to switch between GDB and DBX modes, see section Switching between DBX and GDB Modes.
When debugging an application launched from the Intel® MPI 3.0 and later libraries, issue the following command:
% mpiexec -idb -n <number of processes > [other Intel MPI options ] <executable > [arguments to the executable ]
where N represents number of processes and application is the name of the program you would like to debug.
To attach to an existing MPI job that uses mpich, issue the following command:
% idb -pid launcher pid -parallelattach application
where the launcher pid is the ID of the launcher process that spawned all the processes in the job and the application is the name of the launcher executable. To find the ID of this process, use the command "ps -xf". For example:
$ ps -ax | grep cpi | grep p4pg
1488 pts/38 S 0:00 /users/user_name/mpich-1.2.7p1/examples/basic/cpi -p4pg /users/user_name/mpich-1.2.7p1/mpich1_starters/PI1362 -p4wd /users/user_name/mpich-1.2.7p1/mpich1_starters
1489 pts/38 S 0:00 /users/user_name/mpich-1.2.7p1/examples/basic/cpi -p4pg /users/user_name/mpich-1.2.7p1/mpich1_starters/PI1362 -p4wd /users/user_name/mpich-1.2.7p1/mpich1_starters
To attach to the process, use the ID with the lesser value:
$ idb -pid 1488 -parallelattach cpi
Intel(R) Debugger for IA-32 -based Applications, Version X, Build XXX
Reading symbolic information from /nfs/isv/home/user_name/mpich-1.2.7p1/examples/basic/cpi...done
Attached to process id 1488 ....
stopped at [<opaque> __nanosleep_nocancel(...) 0x001ba81b]
(idb)
[0:3] Intel(R) Debugger for IA-32 -based Applications, Version X, Build XXX
[0:3] Reading symbolic information from /nfs/isv/home/user_name/mpich-1.2.7p1/examples/basic/cpi...done
%1 [0:3] Attached to process id [1488;1544] ....
(idb)
[0:3] stopped at [int main(int, char**):29 0x08049d64]
[0:3] 29 sleep (1);
(idb) w
(idb)
[0:3] 24 MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
[0:3] 25 MPI_Comm_rank(MPI_COMM_WORLD,&myid);
[0:3] 26 MPI_Get_processor_name(processor_name,&namelen);
[0:3] 27
[0:3] 28 while (!stop) {
[0:3] > 29 sleep (1);
[0:3] 30 }
[0:3] 31
[0:3] 32 fprintf(stderr,"Process %d on %s\n",
[0:3] 33 myid, processor_name);
(idb) assign stop=1
(idb)
(idb) n
(idb)
[0:3] stopped at [int main(int, char**):28 0x08049d52]
[0:3] 28 while (!stop) {
(idb)
(idb)
[0:3] stopped at [int main(int, char**):28 0x08049d58]
[0:3] 28 while (!stop) {
(idb)
(idb)
[0:3] stopped at [int main(int, char**):32 0x08049d69]
[0:3] 32 fprintf(stderr,"Process %d on %s\n",
(idb)
For a list of issues with MPI support, see the "Known Limitations" section in the Release Notes.
When the debugger starts your parallel application, it detects and attaches to all of your application's processes. At this point, your application stops before executing any user code and the debugger displays a prompt.
You can now set any necessary breakpoints and use the continue command to continue the execution of your application.
When debugging an application launched by prun, issue the following command at the shell, where n is the number of processes and N is the number of nodes running the processes.
% $IDB_HOME/idb [idb options] -parallel `which prun` -n n -N N [other prun options] application [application arguments]
To start your parallel application under debugger control, you need to have the environment variable IDB_HOME set to the directory that your debugger is in. When debugging an application launched by mpich, issue the following command at the shell, where N represents number of processes and application is the name of the MPP program you would like to debug:
% mpirun -dbg=idb -np N [other mpich options] application [application arguments] [-idb idb options]
Make sure that there is a file called mpirun_dbg.idb in the directory in which mpirun is located. Also note that the Intel IDB option -gdb is not yet supported under parallel debugging session.
When the debugger starts your parallel application, it detects and attaches to all of your application's processes. At this point, your application stops before executing any user code and the debugger displays a prompt.
You can now set any necessary breakpoints and use the continue command to continue the execution of your application.
When debugging an application launched by prun, issue the following command at the shellcommand prompt, where n is the number of processes and N is the number of nodes running the processes.
% $IDB_HOME/idb [idb options] -parallel `which prun` -n n -N N [other prun options] application [application arguments]