“qsub -now” equivalent using bsub

坚强是说给别人听的谎言 提交于 2019-12-11 16:49:29

问题


In SGE , we have

qsub -now yes/no <command>

By "-now yes" the job is scheduled immediately(if possible) or not at all . We are not put in pending queue .

By "-now no " the job is put in pending queue if it cannot be executed immediately .

But in LSF , we have qsub's equivalent as bsub .

in bsub, we are put in pending queue, if it cannot be executed immediately. We don't have option as "-now yes" as in qsub .

Do we something in bsub as "qsub -now"

P.S : One solution is that we can check for some time(some secondss) after running bsub, if we are scheduled or not and then exit . I am searching for a more elegant way .


回答1:


LSF doesn't have the same thing. You could use expect w/ a timeout. LSF will output something like this when the job starts. Your expect script could expect <<Starting on. (But this is basically what your P.S. says.)

$ bsub -Is -m hostA /bin/bash
Job <7536> is submitted to default queue <interactive>.
<<Waiting for dispatch ...>>
<<Starting on hostA>>
hostA$ 

You could maybe use lsrun. But it won't work with the batch system to allocate a slot or other resource.




回答2:


I found the answer in an LSF way.

LSF does provide a way to quit a job if we its unable to schedule the resource. We hava a environment variable LSF_NIOS_PEND_TIMEOUT(specified in minutes) which quits the job, if its still in pending queue.

 env LSF_NIOS_PEND_TIMEOUT=1 bsub -Is -m host /bin/bash

From Somewhere on the web:
LSF_NIOS_PEND_TIMEOUT
Syntax
LSF_NIOS_PEND_TIMEOUT=minutes
Description
Applies only to interactive batch jobs.
Maximum amount of time that an interactive batch job can remain pending.
If this parameter is defined, and an interactive batch job is pending for longer than the specified time, the interactive batch job is terminated.
Valid values
Any integer greater than zero



来源:https://stackoverflow.com/questions/15088536/qsub-now-equivalent-using-bsub

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!