I'm learning how to use MPI, and am confused on the difference between -n and -np when calling a script. For reference, I am trying to run the script on a Slurm cluster with OpenMPI 3.

For instance, I can run my script like this:

mpirun -n 4 --oversubscribe python par_PyScript2.py

or like this:

mpirun -np 4 --oversubscribe python par_PyScript2.py

Can someone describe what these options actually mean?

2

Best Answer


The manual says that -n and -np are synonyms. And so are -c and --n. They instruct mpirun to

Run this many copies of the program on the given nodes.

So it basically is the number of MPI ranks you want. Note that in a Slurm context, you should not specify it explicitly; the information is passed from Slurm to OpenMPI.

Use the manual

man mpirun

Search for that by typing /-n and to go to next match, press n.

From the online manual, I see no option -n. Though, it is possible that -n is just an alias for -np