SLURM:从脚本访问 walltime 限制
SLURM: Access walltime limit from script
是否可以从 SLURM 脚本中访问 walltime 限制?对于 PBS Torque,此问题已得到解答 here。 SLURM 是否有类似的环境价值?
在 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 选项禁止在输出中打印 header。
来自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 上测试
是否可以从 SLURM 脚本中访问 walltime 限制?对于 PBS Torque,此问题已得到解答 here。 SLURM 是否有类似的环境价值?
在 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 选项禁止在输出中打印 header。
来自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 上测试