Parallel Programming Guide for HP-UX Systems

MPI
Running
Chapter 2 47
mpiexec The MPI-2 standard defines mpiexec as a simple method to start MPI applications.
It supports less features than mpirun, but it is portable. mpiexec syntax has three formats:
mpiexec offers arguments similar to a MPI_Spawn call, with arguments as shown in the
following form:
mpiexec [-n
maxprocs
][-soft
ranges
][-host
host
][-arch
arch
][-wdir
dir
][-path
dirs
][-file
file
]
command
-
args
For example:
% $MPI_ROOT/bin/mpiexec -n 8 ./myprog.x 1 2 3
creates an 8 rank MPI job on the local host consisting of 8 copies of the program myprog.x,
each with the command line arguments 1, 2, and 3.
It also allows arguments like a MPI_Spawn_multiple call, with a colon separated list of
arguments, where each component is like the form above.
mpiexec
above
:
above
: ... :
above
For example:
% $MPI_ROOT/bin/mpiexec -n 4 ./myprog.x : -host host2 -n 4
/path/to/myprog.x
creates a MPI job with 4 ranks on the local host and 4 on host2.
Finally, the third form allows the user to specify a file containing lines of data like the
arguments in the first form.
mpiexec [-configfile
file
]
For example:
% $MPI_ROOT/bin/mpiexec -configfile cfile
gives the same results as in the second example, but using the -configfile option (assuming
the file cfile contains -n 4 ./myprog.x -host host2 -n 4 -wdir /some/path ./myprog.x)
where [
mpiexec_ options
] are:
-n
maxprocs
Create
maxprocs
MPI ranks on the specified host.
-soft
range-list
Ignored in HP MPI.
-host
host
Specifies the host on which to start the ranks.
-arch
arch
Ignored in HP MPI.
-wdir
dir
Working directory for the created ranks.
-path
dirs
PATH environment variable for the created ranks.