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 6.

Set the search path as follows:

a.Click on 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:

a.Current working directory

b.Directories in File Search Path

c.Directories specified in your PATH environment variable

6.Click 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.Click 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.

Click 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.Click OK.

9.Click 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 click on Help in the right-hand corner of the process window for additional information.

Debugging Running Applications

As an alternative to the method described in

"Debugging an Application" , it is also possible to "attach"

an instance of TotalView to an application which is already running.

1.

Compile a long-running application as in

"Debugging an Application" :

$ mpicc -g -o Psimple simple.c -lm

2.

Run the application:

 

$ mpirun -srun -n2 Psimple

3.Start TotalView:

$ totalview

4.Click Unattached in the TotalView Root Window to display a list of running processes. Double-click on the srun process to attach to it.

5.The TotalView Process Window appears, displaying information on the srun process. click Attached in the TotalView Root Window.

6.Double-click one of the remote srun processes to display it in the TotalView Process Window.

7.Now you should be able set breakpoints to debug the application.

56 Debugging Applications