[GE users] Number of jobs in queue

elrond1999 aaarseth at atmel.com
Tue Dec 22 11:35:47 GMT 2009

I have a python script that polls qstat -xml for a live view of the jobs in the queue. And as you say that can be a bit intensive, especially with 1000s of jobs. But usually there is just 0-5 jobs running so no problem. So what I wanted was a quick check to get number of jobs and if there are too many just do qstat -s rsah to show running + held jobs. So for now the best I can do is:

def qstat_num_jobs():
    cmd_line = "qstat -u '*' |wc -l"
    (status, output) = commands.getstatusoutput(cmd_line)
    num = int(output)
    if num:
        return num - 2
        return 0

It would have been better if qstat -g c showed pending jobs as well.

xml-qstat is a nice web alternative for sure, and my script does not scale well so in the end I might just use that..


To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].

More information about the gridengine-users mailing list