为什么在 Slurm 中重复调用 squeue 不受欢迎?

Why are repetitive calls to squeue in Slurm frown upon?

为什么不建议在循环中使用 运行 squeue 以避免 Slurm 过载,但是对于来自 LSF 的 bjobs 工具或 qstat 来自上金所?

squeueman page 状态:

PERFORMANCE

Executing squeue sends a remote procedure call to slurmctld. If enough calls from squeue or other Slurm client commands that send remote procedure calls to the slurmctld daemon come in at once, it can result in a degradation of performance of the slurmctld daemon, possibly resulting in a denial of service.

Do not run squeue or other Slurm client commands that send remote procedure calls to slurmctld from loops in shell scripts or other programs. Ensure that programs limit calls to squeue to the minimum necessary for the information you are trying to gather.

据我了解,这不赞成使用例如watch squeue。这种警告通常出现在特定于站点的文档中,例如here:

Although squeue is a convenient command to query the status of jobs and queues, please be careful not to issue the command excessively, for example, invoking the query for the status of a job every five seconds or so using a script after a job is submitted.

相比之下,我发现其他引擎上的类似工具没有这样的警告,例如qstat or bjobs。 我看到人们毫无区别地重复使用所有这些工具,例如here for squeue, here 求职。

上面引用自 Slurm 文档的内容提到了 RPC,它是一种不同于其他引擎的方式吗? Slurm 和其他网格引擎之间是否存在架构差异,使得查询所有作业的状态成本更高?

你是对的,squeue不应该这样使用。加拿大的 HPC 资源也说明了这一点:

Do not run sq or squeue from a script or program at high frequency, e.g., every few seconds. Responding to squeue adds load to Slurm, and may interfere with its performance or correct operation. See Email notification below for a much better way to learn when your job starts or ends.

来源:https://docs.computecanada.ca/wiki/Running_jobs#Use_squeue_or_sq_to_list_jobs

如您所见,加拿大的 HPC 资源建议在使用 sbatch 时使用电子邮件通知:

#SBATCH --mail-user=you@some.email.address
#SBATCH --mail-type=BEGIN
#SBATCH --mail-type=END
#SBATCH --mail-type=FAIL
#SBATCH --mail-type=REQUEUE
#SBATCH --mail-type=ALL

来源:https://docs.computecanada.ca/wiki/Running_jobs#Email_notification

我是 SGE 的重度 qstat 用户,现在更喜欢电子邮件通知。我不需要主动监控工作状态并记录工作何时通过各种里程碑。

实际上,对 运行 squeue 过快的担忧通常更多地来自集群管理员,而不是开发人员。在这种特殊情况下,查看文档特定部分的 commit message,我们了解到它实际上是由 SchedMD 的客户请求的,因此很可能是一个实体 运行 一个生产集群。

该建议的重要性随着集群的规模和工作流动率的增加而增加。在一个 10 节点集群 运行 上,平均每天有 5-6 个作业,您会发现来自十几个用户的 slurm 控制器有许多 squeue 请求。但是在 4000 个节点、10000 个用户、10k jobs/day 上,您可能会以明显的方式干扰 Slurm 性能。

我至少看到一个网站用基于缓存信息的限速版本覆盖了 qstat 命令。

从技术角度来看,大多数替代方案都使用 RPC。