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 formpiexec(all of them are down below, keep scrolling π)executable= the name of an executable MPI programpgmargs= 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>βcdto 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-nargument-env <name> <value>β set the environment variable<name>to<value>for the processes being run bympiexec-envnoneβ pass no environment variables (other than ones specified with other-envor-genvarguments) to the processes being run bympiexec
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 bympiexec-genv <name> <value>β the-genvoptions have the same meaning as their corresponding-envversion, 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 attributeMPI_UNIVERSE_SIZE-lβ label standard out and standard error (stdoutandstderr) 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.mpiexecwill terminate MPI programs that take longer than the value specified byMPIEXEC_TIMEOUT.MPIEXEC_UNIVERSE_SIZEβ set the universe sizeMPIEXEC_PORT_RANGEβ set the range of ports thatmpiexecwill use in communicating with the processes that it starts. The format of this is<low>:<high>. For example, to specify any port between10000and10100, use10000:10100.MPICH_PORT_RANGEβ has the same meaning asMPIEXEC_PORT_RANGEand is used ifMPIEXEC_PORT_RANGEis 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
- nixos 26.05: mpich 5.0.1
- ubuntu stonking: mpich-doc 5.0.1-9 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms