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?

Kat S.
  • 63
  • 4
  • 1
    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) – Hristo Iliev Apr 08 '16 at 09:01
  • The original version was openmpi-1.4.4. I don't know about the configuration. I'll look into that. – Kat S. Apr 08 '16 at 19:21

1 Answers1

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
Hristo Iliev
  • 72,659
  • 12
  • 135
  • 186