HP-MPI Version 2.2.5 for HP-UX Release Note

HP-MPI V2.2.5 for HP-UX Release Note
What’s in This Version
11
Rank Identification Environment Variables
HP-MPI sets several environment variables to let the user access information about the MPI
rank layout prior to calling MPI_Init. These variables differ from the others in this section in
that the user doesn’t set these to provide instructions to HP-MPI; HP-MPI sets them to give
information to the user’s application.
HPMPI=1 This variable is set so that an application can conveniently tell if it is running under
HP-MPI.
MPI_NRANKS This is set to the number of ranks in the MPI job.
MPI_RANKID This is set to the rank number of the current process.
MPI_LOCALNRANKS This is set to the number of ranks on the local host.
MPI_LOCALRANKID This is set to the rank number of the current process relative to the local
host (0.. MPI_LOCALNRANKS-1).
Running Applications
Set the following environment variables:
If you choose to move the HP-MPI installation directory from its default location in
/opt/mpi, set the MPI_ROOT environment variable to point to the location where HP-MPI
is installed.
•Add $MPI_ROOT/bin to PATH.
•Add $MPI_ROOT/share/man to MANPATH.
NOTE HP-MPI must be installed in the same directory on every execution host.
The following is an example of basic compilation and run steps to execute hello_world.c on
a cluster with 4-way parallelism given the ability to rsh/remsh/ssh between hosts. To build
and run hello_world.c on a cluster using an appfile:
Change to a writable directory that is visible on all hosts from which the job will run.
Compile the hello_world executable file:
% $MPI_ROOT/bin/mpicc -o hello_world $MPI_ROOT/help/hello_world.c
Create a file "appfile" as: