切换 HPC 作业
我正在尝试找到一种便捷的方式来浏览我在 HPC 系统上提交的作业。目前,我在 .bashrc
中定义了该函数
peek() {ccc_mpeek "$1" | less;}
,其中 ccc_mpeek
是 HPC 特定函数,用于查看正在运行的作业的输出文件和 $1
code> 参数是 JOBID。
然而,这仍然有点不方便,因为当我想运行上面的函数时,我必须手动复制并粘贴 JOBID(7 位数字)。
我正在寻找一种方法,可以根据 squeue -u user_name
的输出切换 JOBID 作为前一个函数的参数,该输出具有以下标题:
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
I'm trying to find a covenient way to peek through the jobs I have submited on an HPC system. Currently, I have the function
peek() {ccc_mpeek "$1" | less;}
defined in my .bashrc
, where ccc_mpeek
is an HPC specific function to see the output file of a running job and the $1
argument is the JOBID.
However, this is still a little incovenient, since I have to manually copy and paste the JOBID (7 digits) when I want to run the function above.
I'm looking for a way in which I can toggle through JOBID's as the argument to the previous function, based on the output of the squeue -u user_name
, which has the following header:
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
squeue
命令可以选择选择所显示的信息。在您的情况下,您将运行以删除标题(
-H
),仅过滤“运行”作业(-t r
),并且仅显示作业ID(-O%i
)。假设您只有一个作业运行,则可以定义
如果运行多个作业,则需要调整它以仅显示第一个作业(
... | head -1
)或迭代通过循环的作业。
The
squeue
command has an option to choose the information that is displayed. In you case, you would runto remove the header (
-h
) , filter only "running" jobs (-t R
) and only display the job ID (-o %i
).Assuming you have only one job running, you can then define
If you have multiple jobs running, you will need to adapt it to either show only the first job (
... | head -1
) or iterate through the jobs with afor
loop.