ssh-使用qdel一次删除我的所有作业,而不是一次删除
这是一个相当简单的问题,但我找不到答案。
我在群集中运行大量作业(> 20),我想全部删除它们并重新开始。
根据这个站点,我应该能够做到:
qdel -u netid
摆脱它们,但在我的情况下返回:
qdel: invalid option -- 'u'
usage: qdel [{ -a | -c | -p | -t | -W delay | -m message}] [[]|'all'|'ALL']...
-a -c, -m, -p, -t, and -W are mutually exclusive
这显然表明该命令不起作用。
只是为了检查,我做了:
qstat -u
我得到了我所有工作的清单,但是:
qdel -u
也失败了。
9个解决方案
74 votes
找到了埋在旧的supercluster.org线程中的答案:
qselect -u | xargs qdel
完美地工作。
Gabriel answered 2020-02-16T14:48:46Z
41 votes
以加百列的回答为基础:
qselect -u | xargs qdel
qselect -u -s | xargs qdel
将是R,仅用于运行作业。
qselect将允许您根据其他条件选择作业,例如要求的资源(-l),目标队列(-q)...
qdel -u
仅适用于SGE
Y. Boursin answered 2020-02-16T14:49:20Z
10 votes
有时,简单的grep也可以提供帮助:qstat | grep $USER | cut -d. -f1 | xargs qdel
这样,我们还可以为作业指定特定的关键字grep并将其删除。
高温超导
asifzuba answered 2020-02-16T14:49:48Z
3 votes
# Delete all jobs owned by the current user.
#
# Command breakdown:
# ------------------
#
# qselect
# -u selects all jobs that belong to the current user
# -s EHQRTW selects all job states except for Complete
#
# xargs
# --no-run-if-empty Do not run qdel if the result set is empty
# to avoid triggering a usage error.
#
# qdel
# -a delete jobs asynchronously
#
# The backslashes are a trick to avoid matching any shell aliases.
\qselect -u $(whoami) -s EHQRTW | \xargs --no-run-if-empty \qdel -a
Jason answered 2020-02-16T14:50:04Z
3 votes
尝试
$ qdel {id1..id2}
因此,例如:
$ qdel {1148613..1148650}
CiaranWelsh answered 2020-02-16T14:50:29Z
2 votes
另一种可能性是执行qdel all。它会删除每个人的所有作业。 当您无权访问其他人的工作时,它将仅删除您的工作。
这不是最漂亮的解决方案,但肯定是最短的解决方案!
guhur answered 2020-02-16T14:50:54Z
2 votes
对于UGE:
qstat -u | gawk'{print $ 1}'| xargs qdel
teng_wenxuan answered 2020-02-16T14:51:18Z
0 votes
qstat | cut -d. -f1 | sed "s; \(.*\) 0;qdel \1;" | bash
sed的力量。
MrMimic answered 2020-02-16T14:51:38Z
-1 votes
只需使用以下命令:
qdel all
它将取消集群上运行的所有作业。
Viral Solanki answered 2020-02-16T14:52:02Z