[Contents] [Chapter 3] [Chapter 5] [Index]



Profiling and Tracing

This chapter provides a description of profiling and how to produce a log of calls to MPI routines and then view the log. It also provides a description of tracing and how to trace MPI calls. The chapter consists of the following sections:

4.1 Introducing Profiling

Compaq MPI includes modified versions of the profiling library and Upshot viewer that come with the MPICH kit. You can use the profiling library to produce a log of calls to Compaq MPI routines. This records the start and end time of each call and other message information. You can then use Upshot to view, search, and scroll the log.

4.1.1 Differences between Compaq MPI and MPICH Profiling Libraries

The Compaq MPI profiling library differs from the MPICH profiling library in the following ways:

4.1.2 Differences between Compaq MPI and MPICH Upshot

The Compaq MPI version of Upshot differs from the MPICH version in the following ways:

4.1.3 Logging Calls to Compaq MPI Routines

To use the profiling libraries to log calls, follow these steps:

  1. Compile your code in the normal way.

  2. Link to the profiling libraries instead of the normal MPI library.

    For example, for C programs, enter:

    cc -o myprog.log myprog.c -llmpi -lpmpi -lmpi -lrt -pthread

    For example, for Fortran programs, enter:

    f77 -o myprog.log myprog.f -lfmpi -llmpi -lpmpi -lmpi -lrt -pthread

  3. Run the program and it produces a log file called executablename_profile.log, where executablename is the name of the program.

4.1.4 Viewing the Log using Upshot

To use the Compaq MPI version of Upshot, follow these steps:

  1. To start Upshot, enter the following command:

    upshot

    A window appears with an entry field, and Select Logfile, Setup, Options and Quit buttons.

  2. Enter the full name of the log file or use the Select Logfile button to select the log file name from the file browser window.

    For example,

    /usr/examples/mpi/ping_mpi_profile.log

  3. Click on the Setup button.

    A small window appears while the file is loading. When the file is loaded, the timeline window is displayed.

    The features of this window and the actions you can perform are described here:

    Messages sent or received this way are logged as though they are sent or received by the terminating wait or test call. Yellow arrows on a timeline indicate the start and end of a request and go from the send or receive call that initiated the request to the test, wait, or cancel call that ends the request.

    4.2 Introducing Tracing

    You can use the tracing library to output to the standard output, information describing each of the MPI calls executed in the program.

    The information consists of:

    Most send and receive routines indicate the value of count, tag, and partner (destination for send, source for receives).

    4.2.1 Tracing MPI Calls

    To use the tracing library to print trace lines for MPI calls, follow these steps:

    1. Compile your code in the normal way.

    2. Link to the tracing library instead of the normal MPI library.

      For example, for C programs, enter:

      cc -04 -o myprog.log myprog.c -ltmpi -lpmpi -lmpi -pthread -lrt

      For example, for Fortran programs, enter:

      f77 -o myprog.log myprog.f -lfmpi -ltmpi -lpmpi -lmpi -pthread -lrt

    3. Run the program and the trace lines are produced.


    [Contents] [Chapter 3] [Chapter 5] [Index]


    mpi@ilo.dec.com

    Copyright © 1999, Digital Equipment Corporation. All rights reserved. Unpublished rights reserved under the copyright laws of the United States.