mpiexec(1)

πŸ‘‘ NAME πŸ‘‘

mpiexec β€” run an MPI program. yeah. that's the whole job bestie πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

mpiexec args executable pgmargs [ : args executable pgmargs ... ]

okay so let's break that down fr fr:

  • args = command line arguments for mpiexec (all of them are down below, keep scrolling πŸ™ˆ)
  • executable = the name of an executable MPI program
  • pgmargs = command line arguments for the executable

and you can stack multiple executables by using the colon notation (that's for MPMD β€” Multiple Program Multiple Data applications, iconic behavior ✨)

like, this one runs the MPI program a.out on 4 processes:

mpiexec -n 4 a.out

The MPI standard suggests the following arguments and their meanings β€” aka the standard's starter pack πŸŽ€

  • -n <np> β€” specify the number of processes to use
  • -host <hostname> β€” name of host on which to run processes
  • -wdir <working directory> β€” cd to this one before running executable
  • -configfile <name> β€” file containing command-line options. The lines are of the form separated by the colons in the commandline form:
mpiexec {<option arguments>} : {...} : {...} : ... : {...}

Lines beginning with # are comments, and lines may be continued by terminating the partial line with a continuation marker (the manpage shows this spot as blank, no cap, that's just how it printed 😭)

⚠️ okay so these next ones β€” the following options are reserved by the MPI standard, but they are not supported by MPICH (hydra). so like. don't come for hydra about it, it simply does not do these 🫢
  • -arch <architecture name> β€” pick hosts with this architecture type
  • -path <pathlist> β€” use this to find the executable
  • -soft <triplets> β€” comma separated triplets that specify requested numbers of processes (see the MPI-2 specification for more details)
  • -file <name> β€” implementation-defined specification file

Additional arguments that are specific to the MPICH implementation are discussed below πŸ‘‡

The colon character ( : ) may be used to separate different executables for MPMD (multiple program multiple data) programming. for example, to run the program ocean on 4 processes and air on 8 processes, use:

mpiexec -n 4 ocean : -n 8 air

see? colon = the lil glow-up separator πŸ’–


🌈 MPICH-SPECIFIC ARGUMENTS 🌈

MPICH implements a few process managers. Here we list a general set of arguments that many of the implementations support. More detailed options that are supported by a particular implementation, e.g. hydra, are available via:

mpiexec -h
πŸ’‘ lowkey the move is always mpiexec -h before you start guessing, bestie. the specific manager tells you its specific secrets ✨

Many of the implementations of process managers in MPICH support the following arguments to mpiexec:

  • -np <num> β€” a synonym for the standard -n argument
  • -env <name> <value> β€” set the environment variable <name> to <value> for the processes being run by mpiexec
  • -envnone β€” pass no environment variables (other than ones specified with other -env or -genv arguments) to the processes being run by mpiexec

By default, all environment variables are provided to each MPI process (rationale: principle of least surprise for the user) 😌

  • -envlist <list> β€” pass the listed environment variables (names separated by commas), with their current values, to the processes being run by mpiexec
  • -genv <name> <value> β€” the -genv options have the same meaning as their corresponding -env version, except they apply to all executables, not just the current executable (in the case that the colon syntax is used to specify multiple executables)
  • -genvnone β€” like -envnone, but for all executables
  • -genvlist <list> β€” like -envlist, but for all executables
  • -usize <n> β€” specify the value returned for the value of the attribute MPI_UNIVERSE_SIZE
  • -l β€” label standard out and standard error ( stdout and stderr ) with the rank of the process
  • -maxtime <n> β€” set a timelimit of <n> seconds
  • -exitinfo β€” provide more information on the reason each process exited if there is an abnormal exit

πŸ“ ENVIRONMENT VARIABLES FOR MPIEXEC πŸ“

The following environment variables are understood by some versions of mpiexec. The command line arguments have priority over these; that is, if both the environment variable and command line argument are used, the value specified by the command line argument is used. πŸ’… (command line stays winning, as it should)

  • MPIEXEC_TIMEOUT β€” maximum running time in seconds. mpiexec will terminate MPI programs that take longer than the value specified by MPIEXEC_TIMEOUT.
  • MPIEXEC_UNIVERSE_SIZE β€” set the universe size
  • MPIEXEC_PORT_RANGE β€” set the range of ports that mpiexec will use in communicating with the processes that it starts. The format of this is <low>:<high> . For example, to specify any port between 10000 and 10100, use 10000:10100 .
  • MPICH_PORT_RANGE β€” has the same meaning as MPIEXEC_PORT_RANGE and is used if MPIEXEC_PORT_RANGE is not set.

⭐ RETURN STATUS ⭐

mpiexec returns the maximum of the exit status values of all of the processes created by mpiexec . so whichever process was the messiest, that's the number you get 😭


πŸŽ€ LOCATION πŸŽ€

/var/tmp/vc8XKeIJUJ/mpich-5.0.1/src/pm/hydra/mansrc/mpiexec.txt

and that's the whole page, bestie!! πŸ¦‹ this one lives in the HYDRA manual set, the file itself is part of MPICH 5.0.1, and it was dated 4/10/2026 β€” so you know exactly which version you're reading. periodt. πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from