-
Notifications
You must be signed in to change notification settings - Fork 908
Description
Is your feature request related to a problem? Please describe.
I am requesting the following mapping objective: map ranks of MPI+OMP codes as evenly as possible across nodes and spread ranks within nodes as evenly as possible over NUMA domains or L3 caches. This is a show-stopper issue for us.
Also, L3cache
on AMD Zen4 systems (with 8 cores sharing an L3 cache) is incorrectly treated the same as a memory domain mapping.
Describe the solution you'd like
This is a HPC use case: Memory BW (or L3 cache capacity) limited codes would benefit by spreading the ranks evenly over as many memory controllers (L3 Caches) as possible. Example of these codes are large numerical simulation including finite-difference, finite element or finite volume methods. They traverse large swaths of memory easily overwhelming L3 capacities (thus limiting effectiveness of cache-blocking in loops) and are almost exclusively DRAM BW limited. They would most benefit by spreading ranks over as many memory controllers as available. In this scenario users want to launch MPI OMP ranks onto a subset of the available cores so as not to exceed the BW each controller can server to the ranks mapped to these controller.
Unfortunately, OpenMPI's mapping logic is missing the capability of spreading ranks with OMP threads as evenly as possible over nodes and then over numa domains or L3 caches within nodes. When we use a "--map-by resource:span
" or a "--map-by ppr:_N_:resource:span
" clause mapping selects the resource
in sequence and coreectly allocates 1 core (slot) to each rank. However, when we have MPI+OMP codes we need to allocate as many cores to each rank as OMP threads. The syntax for this would be "--map-by resource:PE=n:span", n OMP threads, but this will bunch up all ranks to the first set of nodes that can satisfy the request as opposed to evenly spreading ranks across nodes.
For instance assume 2 nodes with 176 cores each with 2 sockets and 4 memory domains per node. If we want to map say, 32 ranks evenly over NUMA domains we can use
mpirun $CLIMPIOPTS --map-by numa:span -np 16 hostname
that correctly maps 16 ranks evenly across nodes and NUMA domains:
``
$ mpirun $CLIMPIOPTS --map-by socket:span -np 16 hostname
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 0 bound to socket 0[core 0[hwt 0]]: [B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 1 bound to socket 1[core 88[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 2 bound to socket 0[core 1[hwt 0]]: [./B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 3 bound to socket 1[core 89[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 4 bound to socket 0[core 2[hwt 0]]: [././B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 5 bound to socket 1[core 90[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 6 bound to socket 0[core 3[hwt 0]]: [./././B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:103408] MCW rank 7 bound to socket 1[core 91[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 8 bound to socket 0[core 0[hwt 0]]: [B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 9 bound to socket 1[core 88[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 10 bound to socket 0[core 1[hwt 0]]: [./B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 11 bound to socket 1[core 89[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 12 bound to socket 0[core 2[hwt 0]]: [././B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 13 bound to socket 1[core 90[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././B/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 14 bound to socket 0[core 3[hwt 0]]: [./././B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000001.p.ussc.az.chevron.net:99972] MCW rank 15 bound to socket 1[core 91[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
``
However, when we have say 2 OMP threads / rank, using
mpirun $CLIMPIOPTS --map-by numa:PE=2:span -np 16 hostname
maps all ranks to the first node :
``
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 0 bound to socket 0[core 0[hwt 0]], socket 0[core 1[hwt 0]]: [B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 1 bound to socket 0[core 44[hwt 0]], socket 0[core 45[hwt 0]]: [././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 2 bound to socket 1[core 88[hwt 0]], socket 1[core 89[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 3 bound to socket 1[core 132[hwt 0]], socket 1[core 133[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 4 bound to socket 0[core 2[hwt 0]], socket 0[core 3[hwt 0]]: [././B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 5 bound to socket 0[core 46[hwt 0]], socket 0[core 47[hwt 0]]: [././././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 6 bound to socket 1[core 90[hwt 0]], socket 1[core 91[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 7 bound to socket 1[core 134[hwt 0]], socket 1[core 135[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 8 bound to socket 0[core 4[hwt 0]], socket 0[core 5[hwt 0]]: [././././B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 9 bound to socket 0[core 48[hwt 0]], socket 0[core 49[hwt 0]]: [././././././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 10 bound to socket 1[core 92[hwt 0]], socket 1[core 93[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././././B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 11 bound to socket 1[core 136[hwt 0]], socket 1[core 137[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././././././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 12 bound to socket 0[core 6[hwt 0]], socket 0[core 7[hwt 0]]: [././././././B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 13 bound to socket 0[core 50[hwt 0]], socket 0[core 51[hwt 0]]: [././././././././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././.][./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 14 bound to socket 1[core 94[hwt 0]], socket 1[core 95[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././././././B/B/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.]
[ccnpusc4000000.p.ussc.az.chevron.net:111912] MCW rank 15 bound to socket 1[core 138[hwt 0]], socket 1[core 139[hwt 0]]: [./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.][././././././././././././././././././././././././././././././././././././././././././././././././././B/B/./././././././././././././././././././././././././././././././././././.]
``
Describe alternatives you've considered
The meaningful mapping of MPI+OMP codes for even spreading over all resources should let the
--map-by numa:PE=_n_:span
clause allocate n cores per rank and replicate the effect of the same clause with `PE=n' absent.
Additional context
This is a show stopper for us, as we cannot control the placement of the ranks in MPI+OMP codes under to evenly use as many memory controllers as available.