TotalView from Rogue Wave Software is a debugging tool particularly suitable for debugging of parallel applications. It provides both X Window-based Graphical User Interface (GUI) and command line interface (CLI) environments for debugging. This page will teach you how to us Totalview on Odyssey.
Using TotalView on Odyssey
To use Totalview on Odyssey, first you need to load the Totalview module-file to set the correct environment settings. This is done most conveniently by placing the command
module load totalview/184.108.40.206-fasrc01 in your .bashrc startup file.
In order to debug MPI parallel applications, you also need to load appropriate Compiler and MPI software modules, for instance:
module load openmpi/1.8.3-fasrc02
(or place it in your startup file, e.g., .bashrc for the bash shell).
In order to use Totalview, your code must be compiled with the -g option. It is also recommended to suppress any level of optimization by compiling your application with the -O0 option.
Fortran 90: [username@rclogin04 ~]$ mpif90 -g -O0 -o tv_test.x tv_test.f90
C: [username@rclogin04 ~]$ mpicc -g -O0 -o tv_test.x tv_test.c
C++: [username@rclogin04 ~]$ mpicxx -g -O0 -o tv_test.x tv_test.cpp
Note: The instrumented executable should be used for debugging only, not in production runs. After your code is up and running, for actual production runs you need to recompile your application with the desired level of optimization.
To use Totalview, you need to log in with an X window forwarding enabled. If you access Odyssey from a Unix-like system, you have to use the -X or -Y option to ssh. The -Y option often works better for Mac OS X. For instructions on how to enable X11 forwarding when accessing Odyssey from Windows click here.
After loading the Totalview module and compiling with the -g option, request an interactive session:
This will start an interactive (bash) shell and load the module-files included in your startup .bashrc file. Then launch the debugger with one of the following commands:
The Totalview startup GUI will pop up and display debugging startup parameters, as illustrated below. After reviewing them, click OK.
Go to the process window, and click the "Go" button.
Note: At this stage Totalview displays the source code of the mpirun function, NOT the source code of your application.
After you click "GO" in the process window, a small window will pop up, asking whether the mpirun process should be stopped. Click "Yes".
Then, in the "Stack Trace" section of the process window you should see the name of the main program of your application. You can now display the source code by clicking on it. To start debugging, create a break point by clicking on a line number in the source pane, and click "Go". After that, you can use other buttons ("Next", "Step", "Out", etc).
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. Permissions beyond the scope of this license may be available at Attribution.