Louhi User's Guide, the 2nd Edition > Program development > Program development tools > TotalView Debugger
Tehdyt toimenpiteet

TotalView Debugger

Introduction to the TotalView parallel debugger

With Totalview one can

  • run a code under debugger control
  • attach to a running application
  • examine a core file
Running a code under debugger control usually involves setting break and watch points, hitting action points and executing the code line by line. It is also possible to examine values of variables, including pointers and arrays.

Here we discuss only the basic usage, for further information please see TotalView documentation from Cray (Chapter 11)  and Totalview Documentation from Rogue Wave Software.

Preparations

For source level debugging the program must be compiled with the flag -g, e.g.
ftn -g -o myprogram myprogram.f90
Sometimes it is also necessary to disable all compiler optimizations.

Running a code with Totalview


At the moment there are 16 interactive nodes or 32 cores reserved for debugging. If larger debugging runs are needed, please contact CSC HelpDesk. Note that the interactive nodes are strictly meant for debugging, running anything else on these nodes is prohibited.
 
TotalView is launched with e.g.
totalview aprun -a -n 16 ./myprogram
The normal aprun options are given after the TotalView flag -a.  Starting Totalview will make two windows appear on the screen. These are called the Totalview Root and Process Window (or the main window).

To start the execution click the Go button on the main window. This results in TotalView asking if the user wants to stop the program, e.g., for inserting break points. In this case the source code for the main program is displayed on the main window.

The execution can then be started with the Go button.

Some basic features


The current call stack can be seen in the Stack Trace Pane in the main window. To show the source code for a stack entry, click it with the left mouse button.

The values of function or subroutine call parameters, local variables and registers are displayed on the Stack Frame Pane.

To bring up the source code of a file or function type f on the source code window or choose Lookup function from the View menu. Sometimes it is necessary to set a search path for the source files, which can be done via the File menu (Search path).

The easiest way to set a break point is to click the appropriate line number with the left mouse button. Only executable statements with boxed line numbers are allowed for break points. To remove a break point, simply reclick it with the left mouse button.

Running the code line by line is done with the Next, Step and Out buttons. Next steps over subroutine/function calls, Step steps into subroutines/functions and Out steps out from subroutines/functions.

To examine or change a value of a variable right click the variable and select Dive from the pop up menu. To see the values of that variable on all processes select Across Processes from the pop up menu. A new window will show the values and other information from that variable. On that window one can edit the variable values.

Please see the above mentioned TotalView documentation for details.