Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 640
Kat S. Avatar asked Apr 07 '16 22:04

Kat S.


1 Answers

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
like image 56
Hristo Iliev Avatar answered Sep 28 '22 01:09

Hristo Iliev