Exemplar C and Fortran 77 Programmer's Guide

Debugging and profiling

[ Previous Page ] [ Next Page ] [ Contents ]


Last modified on: Wednesday, January 22 1997 at 10:23am

This chapter provides an overview of the debugging and performance analysis tools available on Exemplar systems. The programs discussed in this chapter are optional products. If you are unsure whether a product is installed on your system, check with your system administrator.

See the following documents for more information on these tools:

NOTE: Debugging with the dde and xdb debuggers is not supported with code compiled using the Exemplar compilers.


The CXdb debugger

CXdb is a window-based, symbolic debugger that lets you debug Fortran, C, and C++ programs compiled with the Fortran 77, C, and C++ compilers on Exemplar systems.

To debug using CXdb, you must:

NOTE: If -g is specified, the Exemplar C and Fortran 77 compilers restrict optimizations to the +O0 level.

With CXdb, you can:

CXdb has an X/Motif graphical user interface and a command-line interface for supporting line-oriented terminals.


Using CXdb

To use CXdb in X window mode, follow these steps:

  1. Compile and link (using the compiler driver) your program with the -g option:

    % f77 -g prog.f -Wl,-aarchive_shared

    In this example, the Exemplar linker is automatically used by f77. If you do not use the Exemplar linker, you will not be able to use CXdb on the resulting executable. The -Wl,-aarchive_shared option links in archive libraries; if an archive version of a library is not found, the shared version is used. CXdb does not currently support debugging of shared libraries.

  2. Set your DISPLAY environment variable (if it is not already set). For example if your display's name is mydisplay, in C shell, enter:

    % setenv DISPLAY mydisplay:0.0

  3. Invoke CXdb on the executable file:

    % cxdb a.out &

For additional information on using CXdb, refer to the cxdb(1) man page, the CXdb online help system, or the CXdb Quick Reference.


The CXpa profiler

CXpa is a performance analysis tool for monitoring program performance at user-selectable source code regions, such as routines, loops, and compiler-generated parallel loops.

Types of performance data you can collect include:

Features of CXpa include the ability to:

For more information about these events, see the cxpa(1) man page, the CXpa online help system, or the CXpa Reference.


Using CXpa

The basic steps in the profiling process are as follows:

  1. Prepare the program for profiling, either by compiling with the +pa option or instrumenting it with the cxoi utility (refer to the cxoi(1) man page for more information).

  2. Link the application with the +pa option using the Exemplar linker by means of the compiler driver.

  3. Invoke CXpa (cxpa), specifying the name of the executable you want to profile.

  4. Select the metrics you want to collect and the source code regions (that is, routines and loops) at which you want them to be collected.

  5. Run the program and generate a performance data file (PDF) byRunning the executable under the control of CXpa

    or

    writing instrumentation selections to the executable file, exiting CXpa, and then running the executable outside CXpa to generate performance data files for later analysis with CXpa.

  6. Analyze the results in graphs and reports.
NOTE: The +pa option is not compatible with -p or -G options or with the +O4 or +Oall optimization levels.


[ Previous Page ] [ Next Page ] [ Contents ]