HP-MPI User's Guide (11th Edition)
Understanding HP-MPI
MPI options
Chapter 3 131
Runtime environment variables
Environment variables are used to alter the way HP-MPI executes an
application. The variable settings determine how an application behaves
and how an application allocates internal resources at runtime.
Many applications run without setting any environment variables.
However, applications that use a large number of nonblocking messaging
requests, require debugging support, or need to control process
placement may need a more customized configuration.
Launching methods influence how environment variables are
propagated. To ensure propagating environment variables to remote
hosts, specify each variable in an appfile using the -e option. See
“Creating an appfile” on page 78 for more information.
Setting environment variables on the command line for HP-UX
and Linux
Environment variables can be set globally on the mpirun command line.
Command line options take precedence over environment variables. For
example, on HP-UX and Linux:
% $MPI_ROOT/bin/mpirun -e MPI_FLAGS=y40 -f appfile
In the above example, if some MPI_FLAGS setting was specified in the
appfile, then the global setting on the command line would override the
setting in the appfile. To add to an environment variable rather than
replacing it, use %VAR as in the following command:
% $MPI_ROOT/bin/mpirun -e MPI_FLAGS=%MPI_FLAGS,y -f appfile
In the above example, if the appfile specified MPI_FLAGS=z, then the
resulting MPI_FLAGS seen by the application would be z, y.
% $MPI_ROOT/bin/mpirun -e \
LD_LIBRARY_PATH=%LD_LIBRARY_PATH:/path/to/third/party/lib \
-f appfile
In the above example, the user is appending to LD_LIBRARY_PATH.
Setting environment variables in an hpmpi.conf file
HP-MPI supports setting environment variables in an hpmpi.conf file.
These variables are read by mpirun and exported globally, as if they had
been included on the mpirun command line as "-e VAR=VAL" settings.