How to replace --cpus-per-proc with --map-by in OpenMPI
Asked Answered
S

1

6

I need to update some old codes to work with the most recent version of OpenMPI, but I'm very confused by the new --map-by system. In particular, I'm not sure how to replace --cpus-per-proc N.

Several websites have suggested using --map-by node:pe=N, but when I tried this it gives me a different result.

The original command is:

mpirun -np 3 --report-bindings --bind-to-core --cpus-per-proc 3 ./test.sh

Which gives:

[B/B/B/././././.] [./././././././.] [./././././././.] [./././././././.] 
[./././././././.] [B/B/B/././././.] [./././././././.] [./././././././.] 
[./././././././.] [./././././././.] [B/B/B/././././.] [./././././././.] 

However, when I use the command:

mpirun -np 3 --report-bindings --bind-to core --map-by node:pe=3 ./test.sh

The output is:

[B/B/B/././././.] [./././././././.] [./././././././.] [./././././././.] 
[./././B/B/B/./.] [./././././././.] [./././././././.] [./././././././.] 
[././././././B/B] [B/././././././.] [./././././././.] [./././././././.] 

Could someone please explain how to use the --map-by option?

Senhorita answered 7/4, 2016 at 22:46 Comment(2)
What is your original Open MPI version? The combination of --bind-to-core and --cpus-per-proc should actually result in the second binding map as shown here unless the rmaps_base_schedule_policy MCA parameter has been set to socket in either the environment or in the system/user configuration file (or there is an additional --bysocket option)Davit
The original version was openmpi-1.4.4. I don't know about the configuration. I'll look into that.Senhorita
D
5

To spread four MPI processes over four CPU sockets and have each process bound to three cores of the corresponding socket use:

-n 4 --map-by socket:pe=3 --bind-to core
Davit answered 8/4, 2016 at 10:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.