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?
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).
© 2022 - 2024 — McMap. All rights reserved.