Scientific Computing & Visualization
Help Contact
About Accounts Computation Visualization Documentation Services

How to Initiate the TotalView Debugger

On the Katana cluster, you can use the TotalView debugger to debug your C/C++ and FORTRAN codes. TotalView also has the ability to debug OpenMPI and MPICH compiled MPI codes. TotalView works with both gcc and Portland Group (pgi) compiled codes. TotalView's other features include the ability to track dynamic memory allocations and the limited ability to record and rollback your program's running state through it's ReplayEngine module.

Prerequisites

TotalView is an X-Window application. You will need an X-server capable machine to use it. At BU, if you access Katana from a Windows-based PC, you can download X-Win32 for free to provide this capability.

In order to properly debug your programs using TotalView you must compile your program with the -g flag to turn on debugging. It is also useful to remove all optimization flags from your compile to facilitate debugging

Debugging serial or OpenMP codes with TotalView

Run totalview with your compiled program to start the debugger.


katana:~ % totalview a.out

Debugging MPI compiled codes with TotalView

Run your MPI program using mpirun with the -tv flag to activate the TotalView debugger.


katana:~ % mpirun -tv -np 2 a.out
  • You can run the above on Katana for short MPI jobs. These jobs are limited to 10 mins of CPU time.
  • You also have the choice of submitting the job to the batch system. Just edit your batch script and add the -tv flag to the mpirun command.

    You will also need to add the following to your qsub command:-v DISPLAY This will ensure that TotalView will properly display back on your machine.

    Note that if there are many jobs queued, you may have to wait a long time before your debugging session starts.

Once your TotalView session starts it will present a dialog box asking you for additional "Startup Paramaters" for your code. Do not change any parameters in the "Parallel" tab. Click "OK" once you are ready to start your session.

TotalView will then tell you that it has identified your debug session as a parallel job and ask's if you would like to stop the job now. Answer "Yes"

You can then find the start if your code in the "Stack Trace" frame of the TotalView window. The start of your code will be identified by either "main" or "main.pgi.uni.2"

TotalView Documentation

Documentation on how to use TotalView can be found by clicking on "Help->Documentation" in your TotalView session or on TotalView's web site.

Boston University
Boston University
 
OIT | CCS | July 6, 2009  
Scientific Computing & Visualization Boston University home page Boston University home page