• 2019 Update 7
  • 03/31/2020
Contents

Running an MPI Program

Intel® MPI Library Developer Guide for Linux* OS
Before running an MPI program, place it to a shared location and make sure it is accessible from all cluster nodes. Alternatively, you can have a local copy of your program on all the nodes. In this case, make sure the paths to the program match.
Run the MPI program using the
mpirun
command. The command line syntax is as follows:
$ mpirun -n <# of processes> -ppn <# of processes per node> -f <hostfile> ./myprog
For example:
$ mpirun -n 4 -ppn 2 -f hosts ./myprog
In the command line above:
  • -n
    sets the number of MPI processes to launch; if the option is not specified, the process manager pulls the host list from a job scheduler, or uses the number of cores on the machine.
  • -ppn
    sets the number of processes to launch on each node; if the option is not specified, processes are assigned to the physical cores on the first node; if the number of cores is exceeded, the next node is used.
  • -f
    specifies the path to the host file listing the cluster nodes; alternatively, you can use the
    -hosts
    option to specify a comma-separated list of nodes; if hosts are not specified, the local node is used.
  • myprog
    is the name of your MPI program.
The
mpirun
command is a wrapper around the
mpiexec.hydra
command, which invokes the Hydra process manager. Consequently, you can use all
mpiexec.hydra
options with the
mpirun
command.
For the list of all available options, run
mpirun
with the
-help
option, or see the
Intel® MPI Library Developer Reference
, section
Command Reference > Hydra Process Manager Command
.
Note
The commands
mpirun
and
mpiexec.hydra
are interchangeable. However, you are recommended to use the
mpirun
command for the following reasons:
  • You can specify all
    mpiexec.hydra
    options with the
    mpirun
    command.
  • The
    mpirun
    command detects if the MPI job is submitted from within a session allocated using a job scheduler like PBS Pro* or LSF*. Thus, you are recommended to use
    mpirun
    when an MPI program is running under a batch scheduler or job manager.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804