Mpiexec difference between -n and -np?
Asked Answered
H

1

8

I'm new to the MPI world and there is a question that is really annoying me. What's the real difference between -n and -np?

Holm answered 8/12, 2016 at 15:39 Comment(2)
A lookup in the man page could help you linux.die.net/man/1/mpiexecReliable
With most MPI implementations those two options are synonyms.Genevagenevan
G
7

The MPI standard does not specify how MPI ranks are started and leaves it to the particular implementation to provide a mechanism for that. It only recommends (see Section 8.8 of the MPI 3.1 standard for details) that a launcher (if at all necessary) called mpiexec is provided and -n #procs is among the accepted methods to specify the initial number of MPI processes. Therefore, the question as posed makes no sense unless you specify exactly which MPI implementation you are using. As I already said in my comment, with most implementations both options are synonymous.

Note that some MPI implementations can integrate with batch scheduling systems such as Slurm, Torque, etc., and those might provide their own mechanisms to start an MPI job. For example, Open MPI provides the orterun process launcher, symlinked as mpirun and mpiexec, which understands both -n and -np options. When running within a Slurm job though, srun is used instead and it only understands -n (it actually has a completely different set of options).

Genevagenevan answered 9/12, 2016 at 11:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.