[GE users] Querying available slots with a resource string

Reuti reuti at staff.uni-marburg.de
Sat Nov 10 13:59:05 GMT 2007


Am 09.11.2007 um 00:03 schrieb Brad Falch:

> I figured out how to do it by using qstat instead:
> qselect -l os_version=WS4.0,amd64=1 | xargs qstat -F -q | awk -F=  
> ' /^.*qc:slots/ { sum+=$2 } END { print sum } '
> However, I now have another problem.  We use projects to call out  
> some hosts for interactive and some for batch sessions.  These jobs  
> will go to batch sessions, so I need a way to distinguish between  
> them.  Any ideas there?  (Looks like -P is not available to qselect  
> or qstat, only the submission and admin commands.)

so we have to limit the request to the nodes for this project:

HOSTLIST=`qconf -sq "*@*" | awk ' /^qname/ { qname=$2 } /^host/  
{ host=$2 } /^projects/ { if ($2 == "my_project") { print  
qname"@"host } } '`

will give you the list of nodes which are assigned to my_project. Be  
sure to use something "*@*" in the qconf request to get the queue  
instances (include just one @), otherwise you might get a list of  

In the next step we feed this to the former expression:

qstat -F -q  $HOSTLIST | awk -F= ' /^.*qc:slots/ { sum+=$2 } END  
{ print sum } '

(you could even write it in one line and pipe it again with xargs or  
use the back-quoted expression direct in place).

-- Reuti

To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net

More information about the gridengine-users mailing list