<div dir="ltr">Hello Slurm Users,<div><br></div><div>I am experimenting with the new --prefer soft constraint option in 22.05. The option behaves as described, but is somewhat inefficient if many jobs with different --prefer options are submitted. Here is the scenario:</div><div>  1. submit array of 100 tasks preferring feature A, each task requires 1 CPU</div><div>  2. submit array of 100 tasks preferring feature B, each task requires 1 CPU</div><div>There are two nodes in the cluster:</div><div>  node A, 20 CPUs, has feature A</div><div>  node B, 20 CPUs, has feature B</div><div>What I observe is:</div><div>  1. 20 jobs from the <b>first </b>array are launched on node <b>A</b> (--prefer feature A)</div><div>  2. 20 jobs from the <b>first </b>array are launched on node <b>B</b> (--prefer feature A)</div><div>The 2nd step from above seems sub-optimal, since 20 jobs from the second array preferring feature B could have been launched on node B instead. Ideally, jobs that don't meet the prefer soft constraint can get a lower priority, so that jobs that do meet the soft constraints have a chance to be evaluated and launched. Is this possible?</div><div><br></div><div>If not already possible, I would like to try some ideas by modifying the source code. From the man page, I see</div><div><dl><dt style="box-sizing:border-box;color:rgb(70,84,92);font-family:"Source Sans Pro",Helvetica,Arial,sans-serif"><font size="1"><b style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">--prefer</b>=<<i style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">list</i>><font face="inherit"><span style="border-style:initial;border-color:initial;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;outline-color:initial;outline-width:initial"><a id="gmail-m_-509150350585579860gmail-OPT_prefer" href="https://slurm.schedmd.com/sbatch.html#OPT_prefer" target="_blank" style="color:rgb(226,230,233);box-sizing:border-box;margin:0px;padding:0px 0px 0px 10px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;outline:none;text-decoration-line:none"></a></span></font></font></dt><dd style="box-sizing:border-box;color:rgb(70,84,92);font-family:"Source Sans Pro",Helvetica,Arial,sans-serif"><font size="1">Nodes can have <b style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">features</b> assigned to them by the Slurm administrator. Users can specify which of these <b style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">features</b> are desired but not required by their job using the prefer option. This option operates independently from <b style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">--constraints</b> and will override whatever is set there if possible. When scheduling the features in <b style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">--prefer</b> are tried first if a node set isn't available with those features then <b style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">--constraints</b> is attempted. See <b style="box-sizing:border-box;margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">--constraints</b> for more information, this option behaves the same way.</font></dd></dl></div><div>If someone can point me to where this fallback logic (i.e. from --prefer to --constraint, which could be empty) is implemented in the source code (somewhere in src/slurmctld?), I can try to hack that part and recompile slurm, and report my findings.</div><div><dl><dt style="box-sizing:border-box;color:rgb(70,84,92);font-family:"Source Sans Pro",Helvetica,Arial,sans-serif">Thank you,</dt><dt style="box-sizing:border-box;color:rgb(70,84,92);font-family:"Source Sans Pro",Helvetica,Arial,sans-serif">Manchang</dt></dl></div></div>