* Allow external qstat-f file for raw node status dump.

master
Wirawan Purwanto 8 years ago
parent 7957b28a05
commit 04515dcd35
  1. 22
      sge/node-slot-status.sh

@ -11,12 +11,22 @@
function node_slot_stats_raw()
{
qstat -f | _Process_node_slot_stats_raw
}
function node_slot_stats_raw_f()
{
_Process_node_slot_stats_raw "$1"
}
function _Process_node_slot_stats_raw()
# Prints the node stats from `qstat -f' in raw format:
# - not printing disabled nodes
# - not showing the computational jobs that are running on these nodes
{
qstat -f \
| gawk -v optShowDisabledNodes="$optShowDisabledNodes" \
gawk -v optShowDisabledNodes="$optShowDisabledNodes" \
'
BEGIN {
STDERR = "/dev/stderr"
@ -27,7 +37,7 @@ FNR == 1 && $1 == "queuename" { print; next; }
($0 ~ /^[A-Za-z]/) && (NF == 5 || NF == 6) && (optShowDisabledNodes!=0 || ($6 !~ /d/)) {
print
}
'
' "$@"
}
@ -148,7 +158,11 @@ function node_slot_stats_per_machine_type_f()
case "$1" in
(--raw|raw)
node_slot_stats_raw
if [ "$2" ]; then
node_slot_stats_raw_f "$2"
else
node_slot_stats_raw
fi
;;
(--stats|stats|"")
if [ "$2" ]; then

Loading…
Cancel
Save