Prism 6.0 User's Guide

Requirements of MPI Performance Analysis

You can use Prism's MPI performance analysis features on your Sun MPI program with a minimum number of requirements:

  1. Environment - Prism's performance analysis features use the values of two environment variables, LD_LIBRARY_PATH and PRISM_TNFDIR.

  2. Commands - To collect and analyze probe trace data, you need only use Prism's TNF commands.

  3. Probes - To specify the precise probes to use in your analysis, you need only identify the individual probes by name, by wildcard, or by group.

The following sections describe these three categories.


Note -

You do not need to compile your program with the -g argument to use the TNF performance analysis features of Prism.


Environment Variables

Prism uses the values of two environment variables for performance analysis, PRISM_TNFDIR and LD_LIBRARY_PATH.

PRISM_TNFDIR

Prism uses space in a target directory (by default, /usr/tmp) to store the temporary data generated by the TNF probes. Prism's performance analysis generates large volumes of data, particularly for long-running programs or programs with high process counts. As a result, performance analysis can fail if insufficient disk space is available in the target directory. By default, Prism sets aside 128 Kbytes of storage in the target directory for TNF data. If 128 Kbytes is insufficient for your needs, you can increase the amount of the storage available by using the size parameter of the tnffile command.

If your trace buffer files are too small, once the buffer fills up your data will begin to overwrite older data in the trace buffer. If your trace buffer files exceed the size of your target directory, the data collection process will fail at that stage, before creating the final data file required by tnfview. When you have limited space available in your trace buffer directory, you can shorten the collection time using the tnfcollection command as an event action specifier (for further information about using the tnfcollection command as an event action specifier, see " Actions in Events") or you can limit the types of events collected using the tnfenable command (for further information about using the tnfenable command to selectively control which probes are enabled, see "Enabling Probes Selectively").

You can also define another location for the trace buffer files by setting an environment variable, PRISM_TNFDIR, to the location you choose. For example,

% setenv PRISM_TNFDIR /home/user/tnfdata/tmp

Note -

If you set PRISM_TNFDIR to an NFS-mounted directory, your performance analysis data will be affected by the extra time required for writing the data to non-local directories.


LD_LIBRARY_PATH

Prism uses the value of the LD_LIBRARY_PATH environment variable to identify the directory containing the TNF-instrumented Sun MPI library.


Note -

The LD_LIBRARY_PATH environment variable must be set before issuing Prism's run command.


You can set this environment variable before launching Prism or from the Prism command line. The tnfcollection on comand sets LD_LIBRARY_PATH automatically.

You can change the value of this variable using the Prism's setenv command on Prism's command line. For example:

(prism all) setenv LD_LIBRARY_PATH directory

Settting LD_LIBRARY_PATH For 32-Bit Programs

The standard location for this library for 32-bit programs, running on either Solaris 2.6 or Solaris 7 environments, is /opt/SUNWhpc/lib/tnf. For example, using the C shell:

% setenv LD_LIBRARY_PATH /opt/SUNWhpc/lib/tnf

Settting LD_LIBRARY_PATH For 64-Bit Programs

The standard location for this library for 64-bit programs, on the Solaris 7 environment, is /opt/SUNWhpc/lib/tnf/sparcv9. For example, using the C shell:

% setenv LD_LIBRARY_PATH/opt/SUNWhpc/lib/tnf/sparcv9

MPI Performance Analysis Commands

Prism supplies several commands that allow you to control MPI performance analysis. Only two commands are essential, as long as you accept the default behavior of the commands. The two essential commands are tnfcollection on and tnfview, described later in this chapter. If you chose to exercise greater control over the behavior of the process of MPI performance analysis, you can exercise that control with the additional performance analysis commands.

The Prism MPI performance analysis commands are listed in Table 6-1.

Table 6-1 Performance Analysis Commands

Commands 

Description 

tnffile

Creates the final target file (and optionally sets the trace buffer's size) for TNF probe data. 

tnfenable

Enables selected TNF probes. 

tnfdebug

Redirects TNF probe data to stderr. (This command requires that the Prism run command has been executed.)

tnfdisable

Disables selected TNF probes. (This command requires that the Prism run command has been executed.)

tnfcollection

Turns on | off the TNF collection process. 

tnflist

Displays selected probes and their enabled state. (This command requires that the Prism run command has been executed.)

tnfview

Displays for analysis the probe data contained in the TNF target file. 

For detailed information about the syntax of Prism TNF commands, see the examples in this chapter and the Prism 6.0 Reference Manual.

TNF Probes

Several of the Prism TNF commands (tnflist, tnfdebug, tnfenable, and tnfdisable) take arguments specifying probes by name, by wildcard, and by group name.

The Sun MPI 4.0 Programming and Reference Guide contains a complete list of the names of the probes in the TNF-instrumented Sun MPI library. The list includes the fields defined for each probe.

You can specify probes using arguments that include shell pattern matching wildcards, such as the asterisk (*). These wildcards take the form described in the fnmatch(5) man page.

You can also specify probes by group name. The TNF probe groups defined in the TNF-instrumented version of the Sun MPI library are listed in Table 6-2.

Table 6-2 Sun MPI Library TNF Probe Groups

Probe Group 

Description 

mpi_api

All API-level MPI functions 

mpi_pt2pt

Functions that initiate point-to-point communications 

mpi_blkp2p

All blocking point-to-point calls 

mpi_nblkp2p

All nonblocking point-to-point calls 

mpi_coll

Collective routines 

mpi_procmgmt

Functions that deal with spawning and connecting to jobs 

mpi_comm

Functions that create and manipulate communicators 

mpi_datatypes

Functions that manipulate types or data in respect to types 

mpi_request

Functions that create or operate on requests 

mpi_topo

Functions that create and manipulate topology layouts 

If you choose to insert TNF probes into your own code, you must define your own probe group identifiers. Group identifiers are required in order to use the group name as an argument to the tnfenable, tnfdisable, tnfdebug, and tnflist commands. To add group identifiers to any probes that you create, use the keys argument to the TNF_PROBE macro. For information about the TNF_PROBE macro, see the TNF_PROBE(3X) man page.


Note -

Neither the names of probes that you define nor the names of probe groups that you define should start with mpi_.