Tip 3. How to Find the Sources in a Parallel Debugging Session

The debugger will not be able to display the source lines if it cannot find the source file in the directory specified in the application binary file or in the directory in which the binary resides.

Specifying the -I option in the command line fixes the problem. Note that when launching a debugging session through mpirun, this option should be following the flag -idb. See Starting a Parallel Debugging Session for details on specifying idb options in a command line.

Alternatively, applying the use command or the map source directory command to all the leaf debuggers can overcome the problem as well. For example:

(idb) w

Source file not found or not readable, tried...

    ./cpi.c

    /home/user/Funct/bin/cpi.c

(Cannot find source file mpirun.c)

(idb) use /home/user/Funct/src

   [0:7] Directory search path for source files:

   [0:7]  . /home/user/Funct/bin /home/user/Funct/src

(idb) w

   [0:7]      20

   [0:7]      21 double f(double);

   [0:7]      22

   [0:7]      23 int main(int argc, char *argv[])

   [0:7]      24 {

   [0:7]      25     int done = 0, n, myid, numprocs, i;

   [0:7]      26     double PI25DT = 3.141592653589793238462643;

   [0:7]      27     double mypi, pi, h, sum, x;

   [0:7]      28     double startwtime = 0.0, endwtime;

   [0:7]      29     int  namelen;