H,

After some searching into the code, I may have a clue of what is going on.

I have seen that the commit that launches the error is this one:

72ed146cd2a6facb76e854919fb887faf3fc0c25 (date May. 11th)

I have modified newest version of slurm,  src/srun/libsrun/opt.c (line
2279) to print values of opt

                info("opt.ntasks=%u \n"
                        "opt.ntasks_per_node=%u\n"
                        "opt.min_nodes=%u\n"
                        "opt.ntasks_set=%d\n",

opt.ntasks,opt.ntasks_per_node,opt.min_nodes,opt.ntasks_set);


before the error condition, which is:

                    if ((opt.ntasks_per_node != NO_VAL) &&
                        (opt.ntasks_per_node != (opt.ntasks /
opt.min_nodes))) {
                            if (opt.ntasks > opt.ntasks_per_node)

                                info("Warning: can't honor
--ntasks-per-node "
                                     "set to %u which doesn't match the "
                                     "requested tasks %u with the number of
"
                                     "requested nodes %u. Ignoring "
                                     "--ntasks-per-node.",
opt.ntasks_per_node,
                                     opt.ntasks, opt.min_nodes);
                        opt.ntasks_per_node = NO_VAL;


Result shows the problem:

-bash-4.2$ sbatch --ntasks=16  --tasks-per-node=2  test.sh
-bash-4.2$ more slurm-475.out
srun: opt.ntasks=8
opt.ntasks_per_node=2
opt.min_nodes=8
opt.ntasks_set=1
srun: Warning: can't honor --ntasks-per-node set to 2 which doesn't match
the requested tasks 8 with the number of requested nodes 8. Ignoring
--ntasks-per-node.

-bash-4.2$ sbatch --ntasks=16  --tasks-per-node=4  test.sh
-bash-4.2$ more slurm-476.out
srun: opt.ntasks=4
opt.ntasks_per_node=4
opt.min_nodes=4
opt.ntasks_set=1
OK

-bash-4.2$ sbatch --ntasks=16  --tasks-per-node=8  test.sh
-bash-4.2$ more slurm-477.out
srun: opt.ntasks=2
opt.ntasks_per_node=8
opt.min_nodes=2
opt.ntasks_set=1
OK

-bash-4.2$ sbatch --ntasks=16  --tasks-per-node=16  test.sh
-bash-4.2$ more slurm-478.out
srun: opt.ntasks=1
opt.ntasks_per_node=16
opt.min_nodes=1
opt.ntasks_set=1
OK

The calculation of min_nodes is always correct after the specification of
task_per_node, so the error should not be arising.

Instead, if I do:

-bash-4.2$ sbatch --ntasks=16  --tasks-per-node=16 --nodes=2  test.sh
-bash-4.2$ more slurm-479.out
srun: opt.ntasks=2
opt.ntasks_per_node=16
opt.min_nodes=2
opt.ntasks_set=1
OK

In this case an error should arise, but it does not.

Altogether, I think the condition should be rewritten to something like:
                    if ((opt.ntasks_per_node != NO_VAL) &&
                            if (opt.ntasks < opt.ntasks_per_node
*opt.min_nodes )

but with opt.ntasks being the value introduced by the user, not the one
internally considered by Slurm at this point.  I don't know how to do
correct this, but I hope this helps to point towards the problem.

Best regards,


Manuel

Reply via email to