CARC web archive · Archived copy of ahpcc.unm.edu/Computing/AHPCC/Documentation/User_Guides/debug.html as captured by the Internet Archive on 19 September 2002. Links to pages that were not saved here go to the Wayback Machine. Icons the Internet Archive did not save were redrawn for this copy and are not originals (hover over one to see). Grey boxes mark images that were never archived. Wayback copy · All pages in this snapshot · Web archive index
 Education  (image not archived)

 Debugging and optimizing codes on LosLobos

  1. Available debuggers
    1. GNU gdb
      1. X Windows interface
    2. PGI pgdbg
      1. X Windows interface
  2. Available profilers
    1. PGI pgprof


1.0 Available debuggers

1.1 GNU gdb

The GNU debugger gdb is available on LosLobos for debugging C and C++ codes. Fortran support is not available at this time.

To debug your code using gdb first compile using the '-g' flag for the compiler, and then enter


$ gdb a.out
 

where a.out is your executable.

More information is available by entering "man gdb" to read the man page, or by entering "info gdb".

Note: The gdb debugger does not allow you to debug multiple threads of a MPI code. To debug MPI codes use TotalView.

1.1.1 X Windows interface

The X Windows interface xxgdb to gdb is available. It provides visual feedback and mouse input for the user to control program executions, to examine the function call stack, and to display values of variables. To debug your code enter


$ xxgdb a.out
 

where a.out is your executable. More information is available by entering "man xxgdb" to read the man page.

Note: You must be using a terminal or workstation capable of displaying X Windows in order to use xxgdb. See Using the X Window System for more information.

1.2 PGI pgdbg

The pgdbg debugger from PGI is available on the LosLobos cluster. To debug your code enter


$ pgdbg -text a.out
 

where a.out is your executable. For more information enter "man pgdbg" to read the man page.

Note: The pgdbg debugger does not allow you to debug multiple threads of a MPI code. To debug MPI codes use TotalView.

1.2.1 X Windows interface

The X Windows interface Xpgdbg to pgdbg is available. It provides visual feedback and mouse input for the user to control program executions, to examine the function call stack, and to display values of variables. To debug your code enter


$ Xpgdbg a.out
 

where a.out is your executable.

Note: You must be using a terminal or workstation capable of displaying X Windows in order to use Xpgdbg. See Using the X Window System for more information.

back to Top

2.0 Available profilers

2.1 PGI pgprof

The PGI profiling tool pgprof is available on the LosLobos cluster. To use pgprof to profile your code you must first compile your code using either the -Mprof=func flag or the -Mprof=lines. Then run your code as usual.

After your code finishes a datafile named "pgprof.out" containing the profiling data that will be generated. To examine the datafile on the command line enter:


$ pgprof -s pgprof.out
 

The pgprof tool also has an X Windows interface. To examine the datafile using the X Windows interface enter


$ pgprof pgprof.out
 

More information is available by entering "man pgprof" to read the man page for pgprof.

Note: The PGI profiler pgprof does not allow you to profile multiple threads of a MPI code.

back to Top

[Home] [Inside Us] [Computing] [Research] [Education] [SiteMap]

Please contact our Webmaster with questions or comments.
© Copyright 2001 Albuquerque High Performance Computing Center.  All rights reserved.