6.2.1.6 Debugging an ApplicationThis section describes how to use TotalView to debug an application.

1.Compile the application to be debugged. For example: $ mpicc -g -o Psimple simple.c -lm

Use the -goption to enable debugging information.2.Run the application in TotalView:

$ mpirun -tv -srun -n2 ./Psimple

3.The TotalView main control window, called the TotalView root window, opens. It displays the following message in the window header:

Etnus TotalView Version#

4.The TotalView process window opens.

This window contains multiple panes that provide various debugging functions and debugging information. The name of the application launcher that is being used (either srun or mpirun) is displayed in the title bar.

5.Set the search path if you are invoking TotalView from a directory that does not contain the executable file and the source code. If TotalView is invoked from the same directory, you can skip to step Step 6.

Set the search path as follows:a.Select the File pull-down menu of the TotalView process window.b.Select Search Path from the list that appears.

TotalView, by default, will now search for source and binaries (including symbol files) in the following places and in the following order:

Current working directoryDirectories in File Search PathDirectories specified in your PATH environment variable

6.Select the Go button in the TotalView process window. A pop-up window appears, asking if you want to stop the job:

Process srun is a parallel job. Do you want to stop the job now?

7.Select Yes in this pop-up window. The TotalView root window appears and displays a line for each process being debugged.

If you are running Fortran code, another pop-up window may appear with the following warning:

Sourcefile initfdte.f was not found, using assembler mode.

Select OK to close this pop-up window. You can safely ignore this warning.

8.You can now set a breakpoint somewhere in your code. The method to do this may vary slightly between versions of TotalView. For TotalView Version 6.0, the basic process is as follows:

a.Select At Location in the Action Point pull-down menu of the TotalView process window.

b.Enter the name of the location where you want to set a breakpoint.c.Select OK.9.Select the Go button to run the application and go to the breakpoint.

Continue debugging as you would on any system. If you are not familiar with TotalView, you can select on Help in the right-hand corner of the process window for additional information.

66 Debugging Applications