 |
» |
|
|
 |
The following provides information about utilities you can
use to analyze HP MPI applications. The topics covered
are: Using
counter instrumentation |  |
Counter instrumentation is a lightweight method for generating
cumulative runtime statistics for your MPI applications. When you
create an instrumentation profile, HP MPI creates an ASCII format. You can create instrumentation profiles for applications linked
with the standard HP MPI library, and for applications linked with
HP MPI version 2.0, you can also create profiles for applications
linked with the thread-compliant library. Instrumentation is not
supported for applications linked with the diagnostic library (-ldmpi). Creating
an instrumentation profileCreate an instrumentation profile using one of the following
methods: Use the following syntax: mpirun -i spec -np # program For example, to create an instrumentation profile for an application
called compute_pi.f, enter: % $MPI_ROOT/bin/mpirun -i compute_pi -np 2 compute_pi This invocation creates an instrumentation profile in the
following format: compute_pi.instr (ASCII).
Specify a filename prefix using the
MPI_INSTR environment variable. For example, % setenv MPI_INSTR compute_pi Specifies the instrumentation output file prefix as compute_pi.
Specifications you make using mpirun -i override any specifications you make using the MPI_INSTR environment variable. Viewing
ASCII instrumentation dataThe ASCII instrumentation profile is a text file with the
.instr extension. For example, to view the instrumentation file
for the compute_pi.f application, you can print the prefix.instr file. If you defined prefix for the file as compute_pi, as you did when you created
the instrumentation file in “Creating
an instrumentation profile”, you would print compute_pi.instr. The ASCII instrumentation profile provides the version, the
date your application ran, and summarizes information according
to application, rank, and routines. Figure 2-3 “ASCII
instrumentation profile” is an example of an ASCII instrumentation profile. The information available in the prefix.instr file includes: Overhead time—The time a
process or routine spends inside MPI. For example, the time a process
spends doing message packing. Blocking time—The time a process or routine
is blocked waiting for a message to arrive before resuming execution.
 |  |  |  |  | NOTE: If spin-yield time is changed, overhead and blocking
times become less accurate. |  |  |  |  |
Communication hot spots—The
processes in your application between which the largest amount of
time is spent in communication. Message bin—The range of message sizes
in bytes. The instrumentation profile reports the number of messages
according to message length.
 |  |  |  |  | NOTE: You do not get message size information for MPI_Alltoallv
instrumentation. |  |  |  |  |
Figure 2-3 “ASCII
instrumentation profile” displays the contents
of the example report compute_pi.instr. Using
the profiling interface |  |
The MPI profiling interface provides a mechanism by which
implementors of profiling tools can collect performance information
without access to the underlying MPI implementation source code. Because HP MPI provides several options for profiling your
applications, you may not need the profiling interface to write
your own routines. HP MPI makes use of MPI profiling interface mechanisms
to provide the diagnostic library for debugging. In addition, HP
MPI provides tracing and lightweight counter instrumentation. The profiling interface allows you to intercept calls made
by the user program to the MPI library. For example, you may want
to measure the time spent in each call to a certain library routine
or create a log file. You can collect your information of interest
and then call the underlying MPI implementation through a name shifted
entry point. All routines in the HP MPI library begin with the MPI_ prefix. Consistent with the “Profiling Interface” section
of the MPI 1.2 standard, routines are also accessible using the PMPI_ prefix (for example, MPI_Send and PMPI_Send access the same routine). To use the profiling interface, write wrapper versions of
the MPI library routines you want the linker to intercept. These
wrapper routines collect data for some statistic or perform some other
action. The wrapper then calls the MPI library routine using its PMPI_ prefix. Fortran
profiling interfaceTo facilitate improved Fortran performance, we no longer implement
Fortran calls as wrappers to C calls. Consequently, profiling routines
built for C calls will no longer cause the corresponding Fortran
calls to be wrapped automatically. In order to profile Fortran routines, separate
wrappers need to be written for the Fortran calls.
For example: #include <stdio.h> #include <mpi.h> |
int MPI_Send(void *buf, int count, MPI_Datatype type, int to, int tag, MPI_Comm comm) { printf("Calling C MPI_Send to %d\n", to); return PMPI_Send(buf, count, type, to, tag, comm); |
#pragma _HP_SECONDARY_DEF mpi_send mpi_send_ void mpi_send(void *buf, int *count, int *type, int *to, int *tag, int *comm, int *ierr) |
printf("Calling Fortran MPI_Send to %d\n", *to); pmpi_send(buf, count, type, to, tag, comm, ierr); |
|