HP-MPI User's Guide (11th Edition)
Debugging and troubleshooting
Debugging HP-MPI applications
Chapter 6 199
Using a multi-process debugger
HP-MPI supports the TotalView debugger on Linux and HP-UX for
Itanium-based systems. The preferred method when you run TotalView
with HP-MPI applications is to use the mpirun runtime utility command.
For example,
% $MPI_ROOT/bin/mpicc myprogram.c -g
% $MPI_ROOT/bin/mpirun -tv -np 2 a.out
In this example, myprogram.c is compiled using the HP-MPI compiler
utility for C programs (refer to “Compiling and running your first
application” on page 22). The executable file is compiled with source line
information and then mpirun runs the a.out MPI program:
-g Specifies that the compiler generate the additional
information needed by the symbolic debugger.
-np 2 Specifies the number of processes to run (2, in this
case).
-tv Specifies that the MPI ranks are run under TotalView.
Alternatively, use mpirun to invoke an appfile:
% $MPI_ROOT/bin/mpirun -tv -f my_appfile
-tv Specifies that the MPI ranks are run under TotalView.
-f appfile Specifies that mpirun parses my_appfile to get
program and process count information for the run.
Refer to “Creating an appfile” on page 78 for details
about setting up your appfile.
Refer to “mpirun” on page 74 for details about mpirun.
Refer to the “MPI_FLAGS” on page 137 and the TotalView
documentation for details about MPI_FLAGS and TotalView command line
options, respectively.
By default, mpirun searches for TotalView in your PATH.You can also
define the absolute path to TotalView using the TOTALVIEW environment
variable:
% setenv TOTALVIEW /opt/totalview/bin/totalview \
[totalview-options]
The TOTALVIEW environment variable is used by mpirun.