我曾经使用带有LSF的服务器,但现在我刚刚转换到一个带有SLURM的服务器。
在SLURM中,bpeek(用于LSF)的等效命令是什么?
bpeek bpeek 显示未完成作业的stdout和stderr输出
我无法找到任何文档。如果您有关于SLURM的好参考资料,请让我知道。谢谢!
我刚学到在SLURM中不需要执行bpeek来检查当前标准输出和标准错误,因为它们会实时打印到指定的stdout和stderr文件中。
sattach
命令。squeue
输出的完全相同,尽管我不确定要使用哪个“step”。我在脚本中没有使用srun
,这是否相关?我使用sbatch
和一个带有一些Slurm参数、加载几个模块、cd
后运行单个Python程序的bash脚本来运行我的作业。 - drevicko<jobid>.0
使它对我起作用。(我猜不设置步骤意味着默认处于第0步。) - anderium以下是我使用的一种解决方法。它模仿了 LSF 中的 bpeek
功能。
创建一个名为 bpeek.sh 的文件:
#!/bin/bash
# take as input an argument - slurm job id - and save it into a variable
jobid=$1
# run scontrol show job $jobid and save the output into a variable
#find the string that starts with StdOut= and save it into a variable without the StdOut= part
stdout=$(scontrol show job $jobid | grep StdOut= | sed 's/StdOut=//')
#show last 10 rows of the file if no argument 2 is given
nrows=${2:-10}
tail -f -n $nrows $stdout
然后您可以使用它:
sh bpeek.sh JOBID NROWS(可选)
或者将别名添加到~/.bashrc
文件中:
alias bpeek="sh ~/bpeek.sh $1 $2"
然后使用它:
bpeek JOBID NROWS(可选)
scontrol show job <jobid>
命令来确定标准输出和标准错误输出写入的位置。如果你有很多作业并且不能轻松跟踪哪个作业ID写入了哪个输出,这将非常有用。 - RHSscontrol show job my_job_id
中没有StdOut信息。我猜这意味着它没有保存在任何地方? - Thomas Ahle