/[pdpsoft]/nl.nikhef.ndpf.groupviews/trunk/cores.awk
ViewVC logotype

Contents of /nl.nikhef.ndpf.groupviews/trunk/cores.awk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3248 - (show annotations) (download)
Tue Oct 9 08:53:22 2018 UTC (3 years, 7 months ago) by templon
File size: 402 byte(s)
fixed bug - if 'status' line was missing, node did not get counted.

1 BEGIN { tcores = 0; ocores = 0 }
2 $1 ~ /state/ { state = $3 ; njobs = 0 ; ncores = 0 }
3 $1 ~ /np/ { ncores = $3 }
4 $1 ~ /jobs/ {
5 njobs = split($NF, jobarr, ",")
6 }
7 !/./ {
8 tcores += ncores
9 if (state ~ /offline/) {
10 ocores += ncores - njobs
11 }
12 }
13
14 END {
15 print tcores > "nslots.tmp"
16 system("mv nslots.tmp nslots")
17 print ocores > "oslots.tmp"
18 system("mv oslots.tmp oslots")
19 }

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28