gpt4 book ai didi

qsub - SLURM:从脚本访问 walltime 限制

转载 作者:行者123 更新时间:2023-12-04 03:06:13 25 4
gpt4 key购买 nike

是否可以从 SLURM 脚本中访问 walltime 限制?对于 PBS Torque,此问题已得到解答 here . SLURM 是否有类似的环境值(value)?

最佳答案

在 SLURM 中,walltime 限制是用 --time 设置的:

#SBATCH --time=10:42:00

这个值可以通过 squeue 访问,特别是通过 %l 格式说明符:

$ squeue -h -j $SLURM_JOBID -o "%l"
10:42:00
$

还有一个 %L 格式说明符,它打印出作业执行的剩余时间:

$ squeue -h -j $SLURM_JOBID -o "%L"
10:38:29
$

-h 选项禁止在输出中打印标题。

来自 man squeue:

%l Time limit of the job or job step in days-hours:minutes:seconds. The value may be "NOT_SET" if not yet established or "UNLIMITED" for no limit. (Valid for jobs and job steps)

%L Time left for the job to execute in days-hours:minutes:seconds. This value is calculated by subtracting the job's time used from its time limit. The value may be "NOT_SET" if not yet established or "UNLIMITED" for no limit. (Valid for jobs only)

%M Time used by the job or job step in days-hours:minutes:seconds. The days and hours are printed only as needed. For job steps this field shows the elapsed time since execution began and thus will be inaccurate for job steps which have been suspended. Clock skew between nodes in the cluster will cause the time to be inaccurate. If the time is obviously wrong (e.g. negative), it displays as "INVALID". (Valid for jobs and job steps)

在 slurm 17.02.2 上测试

关于qsub - SLURM:从脚本访问 walltime 限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44133636/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com