切换 HPC 作业

发布于 2025-01-17 09:25:02 字数 537 浏览 3 评论 0原文

我正在尝试找到一种便捷的方式来浏览我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆依然 2025-01-24 09:25:02

squeue命令可以选择选择所显示的信息。在您的情况下,您将运行

squeue -h -t R --me -o %i

以删除标题(-H),仅过滤“运行”作业(-t r),并且仅显示作业ID(-O%i)。

假设您只有一个作业运行,则可以定义

peek() {ccc_mpeek "$(squeue -t R --me -o %i)" | less;}

如果运行多个作业,则需要调整它以仅显示第一个作业(... | head -1)或迭代通过循环的作业。

The squeue command has an option to choose the information that is displayed. In you case, you would run

squeue -h -t R --me -o %i

to 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

peek() {ccc_mpeek "$(squeue -t R --me -o %i)" | less;}

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 a for loop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文