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

How to Initiate the Portland Group pgdbg Debugger

On the Katana, you can use the Portland Group's pgdbg multi-threaded debugger to debug OpenMP FORTRAN or C codes. Due to hardware constraints, debugging MPI code using pgdbg is not available on the Katana.

Debugging OpenMP codes with pgdbg

To start pgdbg, follow the step-by-step procedures shown below:

  • Step 1. Compile the program using the appropriate PGI compiler with -g to turn on debugging. Remove all optimization flags, if used.
  • Step 2. At the system prompt, define the number of threads (1 to 4) for use with debugger.
    
    katana:~ % setenv OMP_NUM_THREADS 2
    
  • Step 3. Launch the pgdbg in the directory where both the source code and executable reside.
    
    katana:~ % pgdbg a.out
    
    • By default, the above launches the GUI-based pgdbg.
      You will need an X-server based windowing software for this to work. At BU, if you access Katana from a Windows-based PC, you can download x-win32 for free.
    • If you prefer command-line instead of GUI debugging environment, add -text.
      You don't need X-server for this mode.
      
      katana:~ % pgdbg -test a.out
      
    • Adding the -dbx flag enables you to issue dbx commands within the debugger environment.
      you need X-server unless you also use the -text option.
  • Step 4. Set breakpoint(s). Then click on the "run" button.

Debugging MPI codes with pgdbg

Not available at the present time.

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