从 Sun Grid Engine 上使用 qsub 提交的进程获取退出代码
我想通过 Sun Grid Engine(现在:Oracle Grid Engine?)上的 qsub 提交作业。我不想使用 -sync yes 选项或 qrsh,因为我希望我的控制程序是单线程的并且能够一次启动多个作业。这些选项会阻塞我的控制程序的线程。
但是,我想收到我启动的进程的退出状态。从手册页来看,似乎没有办法在不阻塞我的线程的情况下获取此代码。如果没有修改我要启动的作业以将其退出代码打印到标准输出,有什么方法可以获取此状态?
I would like to submit jobs via qsub on Sun Grid Engine (now: Oracle Grid Engine?). I do not wish to use the -sync yes option or qrsh, because I want my controlling program to be single-threaded and able to launch many jobs at a time. These options would block my controlling program's thread.
However, I would like to receive the exit statuses of the processes that I launch. From the man pages, there seems to be no way to get this code without blocking my thread. Short of modifying the jobs that I'm launching to print their exit codes to stdout, is there any way to get this status?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案是“qacct -j”。作业历史记录的摘要被打印到标准输出,然后可以解析退出状态、开始和结束时间以及各种其他信息。
但是,必须正确配置 SGE 才能使该命令发挥作用。
The answer is 'qacct -j '. A summary of the history of the job is printed to stdout, which can then be parsed for the exit status, start and end times, and a variety of other information.
SGE must be configured properly for this command to work, however.
如果您在应用程序中提交作业,最简单、最快(比使用 qsub 提交更快)的方式(稍后获取退出状态)是使用 DRMAA API。这个简单的 API 长期以来一直在 Sun Grid Engine 中以 C 语言和 Java 语言提供。 Univa Grid Engine(Grid Engine 的商业后继者)和 Sun Grid Engine 的分支也提供了必要的库。由于它是一个开放标准,您甚至可以提交到完全其他的 DRMS,如 Condor/SLURM 等,而无需更改您的程序。提供 GO、Python 或 TCL(及其他)的语言绑定。
看:
http://www.gridengine.eu/mangridengine/htmlman3/drmaa_wait.html
一些更多信息和 Go (#golang) DRMAA 语言绑定以及示例,您可以
在这里找到:
http://www.gridengine.eu/programming-apis
干杯
丹尼尔
www.gridengine.eu
If you are submitting your jobs within your application, the simplest and fastest (faster then submitting with qsub) way (and getting the exit status later) is using the DRMAA API. This simple API is available in C and in Java in Sun Grid Engine for a very long time. Univa Grid Engine (commercial successor of Grid Engine) and Sun Grid Engine forks also shipping the necessary library. Since it is an open standard you can submit even to completely other DRMS like Condor/SLURM etc. without changing your program. Language bindings for GO, Python, or TCL (and others) are available.
See:
http://www.gridengine.eu/mangridengine/htmlman3/drmaa_wait.html
Some more information and the Go (#golang) DRMAA language binding with examples you can
find here:
http://www.gridengine.eu/programming-apis
Cheers
Daniel
www.gridengine.eu