Parallel Programming Guide for HP-UX Systems

MPI
Debugging
Chapter 256
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.
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.
By default, mpirun searches for TotalView in your PATH settings.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.
NOTE When attaching to a running MPI application, you should attach to the MPI
daemon process to enable debugging of all the MPI ranks in the application.
You can identify the daemon process as the one at the top of a hierarchy of MPI
jobs (the daemon also usually has the lowest PID among the MPI jobs).
Limitations The following limitations apply to using TotalView with HP MPI applications:
1. All the executable files in your multihost MPI application must reside on your local
machine, that is, the machine on which you start TotalView. Refer to “TotalView multihost
example” on page 57 for details about requirements for directory structure and file
locations.
2. TotalView sometimes displays extra HP-UX threads that have no useful debugging
information. These are kernel threads that are created to deal with page and protection
faults associated with one-copy operations that HP MPI uses to improve performance. You
can ignore these kernel threads during your debugging session.