如何为 Slurm 作业设置最高优先级?

How to set the maximum priority to a Slurm job?

作为管理员,我需要给予给定作业最高优先级。

我发现 --priority=<value>--nice[=adjustment] 等提交选项可能会有用,但我不知道应该为它们分配哪些值才能为作业提供最高优先级。

另一种方法是默认为所有作业设置低优先级,并为特殊作业提高优先级。

知道如何执行吗?

编辑:我正在使用 sched/backfill 策略和默认作业优先级策略 (FIFO)。

谢谢。

我做的是使用优先级插件multifactor,默认配置,将这一行添加到slurm.conf:

PriorityType=priority/multifactor

然后,由于所有作业的优先级均为 0,我必须更新目标作业的优先级,在我的例子中使用 API:

job_desc_msg_t job_update;
slurm_init_job_desc_msg(&job_update);
job_update.job_id = target_job_id;
job_update.priority = 4294967295;
slurm_update_job(&job_update);

已编辑:

来自Slurm FAQ

The job's priority is an integer that ranges between 0 and 4294967295. The larger the number, the higher the job will be positioned in the queue, and the sooner the job will be scheduled.

我找到了一个无需使用 PriorityType=priority/multifactor(如 )即可工作的解决方案:

$ scontrol update job=<job-id> Priority=<any-integer>

以上命令将更新作业的优先级并相应地更新队列。

成为下一个作业所需的最低优先级可以通过检查下一个待处理作业的优先级并向其添加一个来找到。您可以使用以下方法查找作业的优先级:

$ scontrol show job=<job-id>

(scontrol update可以用来改变工作的很多方面,比如 and others。)

编辑:

我刚学会一招

$ scontrol top <job-id>

将工作排在他们队列的首位。