/[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 2764 - (show annotations) (download)
Fri Jan 30 14:29:48 2015 UTC (7 years, 6 months ago) by templon
File size: 375 byte(s)
update ndpf-gv-mkplots for new alltime range; update cores.awk to prevent
problem with ndpf-gv-dbupdate -- that program tried to read number of slots
while cores.awk was busy writing it, found an empty file.


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

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