Home

mpirun

mpirun is a command-line launcher used to start programs that use the Message Passing Interface (MPI) on distributed-memory systems. It is provided by MPI implementations such as Open MPI and MPICH, and in some environments by vendor-specific MPI products. mpirun coordinates the creation of multiple processes across compute nodes and establishes the communication infrastructure required by the MPI program.

Typical usage includes launching a fixed number of processes on the local host, for example: mpirun -np

Internals and options: mpirun forwards launcher and runtime options to the underlying MPI runtime, including process

Compatibility and variants: While mpirun is widely available, some MPI implementations also provide mpiexec or use

See also: Message Passing Interface, Open MPI, MPICH, Intel MPI, batch schedulers.

4
./a.out.
More
complex
configurations
specify
where
to
run
the
processes,
using
host
lists,
host
files,
or
resource
managers:
mpirun
-np
8
--hostfile
hosts
./a.out
or
mpirun
-np
8
--map-by
ppr:2:node
./a.out.
mpirun
can
also
cooperate
with
batch
schedulers
(such
as
Slurm,
PBS,
or
SGE)
to
acquire
resources,
or
run
in
a
stand-alone
mode
when
resources
are
already
allocated.
placement
(--map-by),
binding
(--bind-to),
and
various
-mca
or
equivalent
parameters
depending
on
the
implementation.
It
sets
necessary
environment
variables
and
may
influence
library
loading
or
the
use
of
the
dynamic
linker.
In
practice,
mpirun
acts
as
a
wrapper
around
the
MPI
runtime’s
process-spawning
and
initialization
mechanisms
(for
example
ORTE
in
Open
MPI
or
PMI
in
MPICH).
mpirun
as
a
synonym.
The
exact
options
and
syntax
can
differ
between
implementations,
so
users
should
consult
their
MPI
documentation
for
implementation-specific
behavior.