Determining number of nodes or cores available in an SGE Queue

To determine the status of a queue in SGE, one can issue the command qstat -g c to get such information like number of CPU available and the current CPU and memory load. However, this information can be misleading when nodes can be cross-listed in multiple Q’s. A Q can say X number of nodes are unused, when in reality, they are in use in a different Q. Consequently, a submitted parallel job asking for X cores can wait in limbo for quite some time depending on the cluster’s load. The following sgeQload.R R script uses some commands explained in the cheat sheet to output the number of cores really available:

<pre class="example">#! /bin/env Rscript

This script shows me the number of cores available for each Q.

Since many Q’s on BDUC contain overlapping nodes, information from “qstat -g c” could be misleading and lead to submitted jobs that are waiting…