Check slots_used on all SGE queues
This commit is contained in:
parent
35b9846c80
commit
04b4befbc6
|
@ -138,16 +138,20 @@ is_job_running() { # {{{
|
||||||
|
|
||||||
local_sge_hostname="${1}"
|
local_sge_hostname="${1}"
|
||||||
## List SGE informations about the host
|
## List SGE informations about the host
|
||||||
### And get the number of used slots
|
### And get the number of used slots from all queues
|
||||||
|
### Sort the results
|
||||||
|
### Only get the last result (greater number of used slots)
|
||||||
local_sge_slots_used=$(qhost -h "${local_sge_hostname:=/dev/null}" -q -xml \
|
local_sge_slots_used=$(qhost -h "${local_sge_hostname:=/dev/null}" -q -xml \
|
||||||
| grep slots_used \
|
| grep slots_used \
|
||||||
| sed 's;.*<queuevalue.*>\(.*\)</queuevalue>;\1;')
|
| sed 's;.*<queuevalue.*>\(.*\)</queuevalue>;\1;' \
|
||||||
|
| sort --numeric-sort \
|
||||||
|
| tail --lines=1)
|
||||||
|
|
||||||
case "${local_sge_slots_used}" in
|
case "${local_sge_slots_used}" in
|
||||||
0 ) ## No jobs are running
|
0 ) ## No jobs are running
|
||||||
return_job_running="1"
|
return_job_running="1"
|
||||||
;;
|
;;
|
||||||
* ) ## Results (header + queue name) so the queue is disable
|
* ) ## Some jobs are running
|
||||||
return_job_running="0"
|
return_job_running="0"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue