Skip to content

core assignments with unbalanced tasks per node #7174

@ryanday36

Description

@ryanday36

When one asks for a number of tasks that is evenly divisible by the number of nodes requested, Flux binds all of those tasks to the same number of cores. E.g.

day36@fluke131:~]$ flux run -N2 -n2 --cores-per-task=1 -o mpibind=off -o cpu-affinity=per-task --label numactl -s | grep physcpu
0: physcpubind: 1
1: physcpubind: 1

If the number of tasks is not divisible evenly across the nodes, Flux allows some tasks to access more cpus:

[day36@fluke131:~]$ flux run -N2 -n3 --cores-per-task=1 -o mpibind=off -o cpu-affinity=per-task --label numactl -s | grep physcpu
0: physcpubind: 0
2: physcpubind: 0 1
1: physcpubind: 1

This example uses the built-in cpu-affinity shell option, but this is also affecting mpibind and causing it to improperly bind gpus in cases where the user asks for a number of gpus that isn't evenly divisible by the number of nodes. E.g.

day36@rzadams1041:$ MPIBIND_RESTRICT= flux run -N2 -n7 --gpus-per-task=1 --cores-per-task=24 --label -o mpibind=v bash -c 'echo $ROCR_VISIBLE_DEVICES'
0.072s: flux-shell[1]: mpibind:
mpibind: task 0 nths 96 gpus 0,1 cpus 0-47,96-143
mpibind: task 1 nths 48 gpus 2 cpus 48-71,144-167
mpibind: task 2 nths 48 gpus 3 cpus 72-95,168-191
0.070s: flux-shell[0]: mpibind:
mpibind: task 0 nths 24 gpus 0 cpus 0-23
mpibind: task 1 nths 24 gpus 1 cpus 24-47
mpibind: task 2 nths 24 gpus 2 cpus 48-71
mpibind: task 3 nths 24 gpus 3 cpus 72-95
0: 0
4: 0,1
1: 1
5: 2
6: 3
2: 2
3: 3
day36@rzadams1041:$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions