HP-MPI User's Guide (11th Edition)

Profiling
Using counter instrumentation
Chapter 4176
off Specifies counter instrumentation is initially turned off
and only begins after all processes collectively call
MPIHP_Trace_on.
For example, to create an instrumentation profile for an executable
called compute_pi:
% $MPI_ROOT/bin/mpirun -i compute_pi -np 2 compute_pi
This invocation creates an ASCII file named compute_pi.instr
containing instrumentation profiling.
Although -i is the preferred method of controlling instrumentation, the
same functionality is also accessible by setting the MPI_INSTR
environment variable. Refer to “MPI_INSTR” on page 147 for syntax
information.
Specifications you make using mpirun -i override any specifications you
make using the MPI_INSTR environment variable.
MPIHP_Trace_on and MPIHP_Trace_off
By default, the entire application is profiled from MPI_Init to
MPI_Finalize. However, HP-MPI provides the nonstandard
MPIHP_Trace_on and MPIHP_Trace_off routines to collect profile
information for selected code sections only.
To use this functionality:
1. Insert the MPIHP_Trace_on and MPIHP_Trace_off pair around code
that you want to profile.
2. Build the application and invoke mpirun with the -i <prefix> off;
option. -i <index> off; specifies that counter instrumentation is
enabled but initially turned off (refer to “mpirun” on page 74 and
“MPI_INSTR” on page 147). Data collection begins after all processes
collectively call MPIHP_Trace_on. HP-MPI collects profiling
information only for code between MPIHP_Trace_on and
MPIHP_Trace_off
Viewing ASCII instrumentation data
The 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