/[MITgcm]/mitgcm.org/scripts/testing_score
ViewVC logotype

Contents of /mitgcm.org/scripts/testing_score

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Tue Nov 1 16:52:32 2022 UTC (2 years, 2 months ago) by jmc
Branch: MAIN
Changes since 1.1: +20 -5 lines
use same default list of platforms as in "check_out"

1 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/mitgcm.org/scripts/testing_score,v 1.1 2022/11/01 16:45:30 jmc Exp $
4 #
5 # The purpose of this script is to print the testing score of all testreport results
6 # stored in the monthly archive dir, either from few selected platform or from all platform
7
8 #INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD"
9 INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
10 #INDIR="./2009_06"
11 INDIR="."
12
13 YYMM=`( cd $INDIR ; pwd | sed 's/\// /g' | awk '{print $NF}' | sed 's/_//' )`
14 xx=`echo $YYMM | sed 's/[0-9]*/x/'`
15 #echo "YYMM='$YYMM' ; xx='$xx'"
16 if test $xx != x ; then YYMM=`date +%Y%m` ; fi
17 ( cd $INDIR ; ls -1 *_${YYMM}??_*/summary.txt | sed 's/\/summary.txt//' ) > ./dir_all
18 #( cd $INDIR ; ls -1 -t *_${YYMM}??_*/summary.txt | sed 's/\/summary.txt//' ) > ./dir_all
19
20 addHost=0
21 if [ $# -gt 0 ] ; then if test $1 = '+h' ; then
22 addHost=1 ; shift
23 fi ; fi
24 if test $# = 0 ; then
25 #-- local way of getting all platforms:
26 #MALL=`cat ./dir_all | sed -e 's|_| |g' | sed -e 's|\-| |' | sed -e 's|\+| |' \
27 # | awk '{print $2}' | sort | uniq`
28 #echo $MALL
29 #MACHINES=$MALL
30 #-- as done in "make_summary" (front_content/) and "check_outp" (scripts/):
31 MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`
32 MACHINES="villon batsi engaging1 engaging- svante"
33 MACHINES="$MACHINES glacier ollie pleiades"
34 for madd in $MALL ; do
35 present=0
36 for m in $MACHINES ; do
37 echo $madd | grep $m > /dev/null 2>&1
38 RETVAL=$?
39 test $RETVAL = 0 && present=1
40 continue
41 done
42 test $present = 0 && MACHINES="$MACHINES $madd"
43 done
44 else
45 MACHINES=$*
46 fi
47
48 for mname in $MACHINES ; do
49
50 #echo " $mname"
51 printf '== %-30s ======================\n' "$mname :"
52
53 dir_list=`grep $mname ./dir_all`
54 #echo -n "" > ./mlist
55
56 #- re-order dir_list:
57 sub_list=`grep $mname ./dir_all | sed "s/_$YYMM.._/_YYYYMMDD_/g" | sort | uniq`
58 #echo 'sub_list=' $sub_list '<'
59 dir_list=''
60 for i in $sub_list ; do
61 pp=`echo $i | sed 's/_YYYYMMDD_.*$//'`
62 ss=`echo $i | sed 's/^.*_YYYYMMDD_//'`
63 #add=`grep "${pp}_${YYMM}.._${ss}$" ./dir_all`
64 #dir_list="$dir_list $add"
65 dir_list="$dir_list "`grep "${pp}_${YYMM}.._${ss}$" ./dir_all`
66 done
67 #echo 'dir_list=' $dir_list '<'
68
69 for i in $dir_list ; do
70
71 dir=$INDIR"/"$i
72 OPTFILE=
73 if test -r $dir/summary.txt ; then
74 comm=`grep 'OPTFILE=' $dir/summary.txt`
75 eval $comm
76 OPTFILE=${OPTFILE##*/}
77 fi
78 if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then
79 comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`
80 eval $comm
81 OPTFILE=${OPTFILE##*/}
82 fi
83 if test "x$OPTFILE" = x ; then
84 comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`
85 comm=${comm##*#}
86 eval $comm
87 OPTFILE=${OPTFILE##*/}
88 fi
89 if test "x$OPTFILE" = x ; then
90 OPTFILE="not_explicitly_specified"
91 fi
92
93 ADJOINT=0
94 TANGLIN=0
95 OPENAD=0
96 RESTART=0
97 EXTRA=
98 FAST=0
99 DVLP=0
100 MPI=0
101 MTH=0
102 UR4=0
103 HOST=''
104 if test -r $dir/summary.txt ; then
105 ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt`
106 if test "x$ADJOINT" = x1 ; then
107 OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`
108 fi
109 TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt`
110 if test "x$TANGLIN" = x1 ; then
111 OPENAD=`grep -c '^TangLin .* OpenAD' $dir/summary.txt`
112 fi
113 RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
114 FAST=`grep -c "^run: .*testreport.* '*-fast'*" $dir/summary.txt`
115 if test "x$FAST" = x0 ; then
116 FAST=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`
117 fi
118 DVLP=`grep -c "^run: .*testreport.* '*-devel'*" $dir/summary.txt`
119 MPI=`grep -c "^run: .*testreport.* -mpi " $dir/summary.txt`
120 if test "x$MPI" = x0 ; then
121 MPI=`grep -c "^run: .*testreport.* -MPI " $dir/summary.txt`
122 fi
123 MTH=`grep -c "^run: .*testreport.* -mth " $dir/summary.txt`
124 UR4=`grep -c "^run: .*testreport.* -use_r4 " $dir/summary.txt`
125 if test "x$UR4" = x0 ; then
126 UR4=`grep -c "^run: .*testreport.* -ur4 " $dir/summary.txt`
127 fi
128 if test $addHost = 1 ; then
129 HOST=`grep '^on : ' $dir/summary.txt \
130 | awk '{print $4}' | sed 's/\..*$//'`
131 fi
132 fi
133 if test "x$ADJOINT" = x1 ; then
134 kind="adm-TAF" ; order=0
135 if test "x$OPENAD" = x1 ; then kind="adm-OAD" ; order=2 ; fi
136 elif test "x$TANGLIN" = x1 ; then
137 kind="tlm-TAF" ; order=1
138 if test "x$OPENAD" = x1 ; then kind="tlm-OAD" ; order=3 ; fi
139 elif test "x$RESTART" = x0 ; then
140 kind="forward" ; order=4
141 else
142 kind="restart" ; order=5
143 fi
144 if test "x$UR4" = x1 ; then
145 OPTFILE="${OPTFILE}.use_r4"
146 fi
147 if test "x$MPI" = x1 ; then
148 yy=`echo $OPTFILE | grep -c '+mpi'`
149 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
150 fi
151 if test "x$MTH" = x1 ; then
152 yy=`echo $OPTFILE | grep -c '+mth$'`
153 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
154 fi
155 if test "x$FAST" = x1 ; then
156 OPTFILE="${OPTFILE}.fast"
157 fi
158 if test "x$DVLP" = x1 ; then
159 OPTFILE="${OPTFILE}.dvlp"
160 fi
161
162 t_pass="--"
163 t_tot="--"
164 if test -r $dir/summary.txt ; then
165 grep '^[YN] [YN] [YN] [YN]' $dir/summary.txt > ./all_tests 2>/dev/null
166 t_tot=`cat ./all_tests | wc -l | sed -e 's| ||g'`
167 #t_pass=`grep 'pass ' ./all_tests | wc -l | sed -e 's| ||g'`
168 t_pass=`grep '^Y Y Y Y' $dir/summary.txt | grep 'pass ' | wc -l | sed -e 's| ||g'`
169 fi
170 rm -f ./all_tests
171 #echo "${dir##*/} : $t_pass out of $t_tot (of=$OPTFILE , $kind)"
172 if test $OPTFILE = 'sp5-32' -a $kind = 'forward' ; then
173 echo "${dir##*/} : $t_pass out of $t_tot (of=$OPTFILE , $kind)"
174 fi
175
176 #echo "$OPTFILE$kind $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> ./mlist
177 if test $addHost = 1 ; then
178 if [ $t_tot -lt 100 ] ; then
179 printf ' %3i:%2.2i %-40s %s %-40s %s\n' $t_pass $t_tot $i $kind $OPTFILE $HOST
180 else
181 printf ' %3i:%3.3i %-40s %s %-40s %s\n' $t_pass $t_tot $i $kind $OPTFILE $HOST
182 fi
183 else
184 if [ $t_tot -lt 100 ] ; then
185 printf ' %3i:%2.2i %-40s %s %s\n' $t_pass $t_tot $i $kind $OPTFILE
186 else
187 printf ' %3i:%3.3i %-40s %s %s\n' $t_pass $t_tot $i $kind $OPTFILE
188 fi
189 fi
190
191 done
192
193 # helpful for debugging
194 #cat ./mlist
195
196 done
197
198 #rm -f ./mlist
199 rm -f ./dir_all

  ViewVC Help
Powered by ViewVC 1.1.22