[GE users] Number of jobs in queue

reuti reuti at staff.uni-marburg.de
Tue Dec 22 10:47:08 GMT 2009


Am 22.12.2009 um 10:04 schrieb elrond1999:

> I'm writing some scripts and need to know how many jobs there are  
> running + pending in a queue. The only way I could find is
> qstat -u'*' |wc -l, but that seems crude. Is there a better way?

(There is a header which you will have to subtract from the sum.)

a) you can try `qstat -g c` for the used slots

b) There are two scripts at:

http://gridengine.sunsource.net/files/documents/7/8/status-1.2.tgz

http://gridengine.sunsource.net/files/documents/7/208/status-1.4.tgz

The latter one needs a newer gawk version, but includes a switch -r  
for the elapsed runtime (the -h flag will list all options). Besides  
using it in the plain version to list your own jobs, you can use  
"status -ag" and "status -acl" to list all jobs in a form like (and  
it will list 25 chars for the jobname):

$ status -acl

                 running #jobs/#slots
Owner        serial   parallel    total
---------------------------------------
abcd001       0/  0    13/ 26    13/ 26
fubar         0/  0     4/ 14     4/ 14
fubar01       2/  2     2/  8     4/ 10
jim           0/  0     1/  4     1/  4
xxxx       12/ 12     3/ 10    15/ 22
xxxx          1/  1     0/  0     1/  1
xxxxxx        0/  0     2/  4     2/  4
xxxx         11/ 11     9/ 18    20/ 29
xxxx          1/  1     0/  0     1/  1
---------------------------------------
Sum          27/ 27    34/ 84    61/111


                 waiting #jobs/#slots
Owner        serial   parallel    total
---------------------------------------
jim           0/  0     1/  8     1/  8
---------------------------------------
Sum           0/  0     1/  8     1/  8


Maybe you can use some part of the script for your own.

-- Reuti


> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do? 
> dsForumId=38&dsMessageId=234568
>
> To unsubscribe from this discussion, e-mail: [users- 
> unsubscribe at gridengine.sunsource.net].

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=234584

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



More information about the gridengine-users mailing list