'bsub < 的优点/缺点是什么脚本.sh'

发布于 2025-01-15 03:36:16 字数 725 浏览 2 评论 0 原文

考虑第一个 script_0.sh

# script_0.sh

foo
bar
baz

我可以像这样通过 LSF 运行这个脚本,例如:

bsub -q myqueue -J myjob_0 -o path/to/log_0.out -e path/to/log_0.err -- /bin/sh ./script_0.sh

现在考虑第二个非常相似的脚本:

# script_1.sh

#BSUB -q myqueue
#BSUB -J myjob_1
#BSUB -o path/to/log_1.out
#BSUB -e path/to/log_1.err

foo
bar
baz

我也可以通过 LSF 运行这个脚本,如上所示(之后适当地更改命令行选项),但是,此外,我可以这样做:

bsub < script_1.sh

在第二种形式中,bsub 通过解析以 #BSUB 开头的行

据我了解,如果我们排除注释和空行,上述所有形式都需要运行完全相同的命令(foo等),因为这两个脚本是相同的。

与第一种形式相比,第二种形式的优点/缺点是什么?特别是,这两种形式是否可以实现另一种形式难以或不可能实现的作业调度策略?

Consider first script_0.sh:

# script_0.sh

foo
bar
baz

I can run this script via LSF like this, for example:

bsub -q myqueue -J myjob_0 -o path/to/log_0.out -e path/to/log_0.err -- /bin/sh ./script_0.sh

Now consider a second, very similar script:

# script_1.sh

#BSUB -q myqueue
#BSUB -J myjob_1
#BSUB -o path/to/log_1.out
#BSUB -e path/to/log_1.err

foo
bar
baz

I can also run this script, via LSF, as shown above (after changing the command-line options appropriately), but, in addition, I can do it like this:

bsub < script_1.sh

In this second form, bsub figures out the options to use by parsing the lines beginning with #BSUB .

As far as I understand, all the forms described above would entail running exactly the same commands (foo, etc.), since the two scripts are identical, if we exclude comments and blank lines.

What are the pros/cons of this second form vis-à-vis the first form? In particular, does either form make possible job scheduling strategies that are difficult or impossible to implement with the other form?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文