assign two MPI processes per core

Viewed 13832

How do I assign 2 MPI processes per core?

For example, if I do mpirun -np 4 ./application then it should use 2 physical cores to run 4 MPI processes (2 processes per core). I am using Open MPI 1.6. I did mpirun -np 4 -nc 2 ./application but wasn't able to run it.

It complains mpirun was unable to launch the specified application as it could not find an executable:

5 Answers

Using Open MPI 4.0, the two commands:

mpirun --oversubscribe -c 8 ./a.out

and

mpirun -map-by hwthread:OVERSUBSCRIBE -c 8 ./a.out

worked for me (I have a Ryzen 5 processor with 4 cores and 8 logical cores).

I tested with a do loop that includes operations on real numbers. All logical threads are used, though it seems that there is no speedup benefit since computation takes double the amount of time compared to using -c 4 option (with no oversubscribing).

You can run mpirun --use-hwthread-cpus ./application

In this case, Open MPI will consider that a processor is a thread provided by the Hyperthreading. This contrasts with the default behavior when it considers that a processor is a CPU core.

Open MPI denotes the threads provided by the Hyperthreading as "hardware threads" when you use this option, and allocates one Open MPI processor per "hardware thread".

Related