/[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.1 - (show annotations) (download)
Tue Nov 1 16:45:30 2022 UTC (15 months, 3 weeks ago) by jmc
Branch: MAIN
simple script to list testing score

1 #! /usr/bin/env bash
2
3 # $Header: $
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 #MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`
21 MALL=`cat ./dir_all | sed -e 's|_| |g' | sed -e 's|\-| |' | sed -e 's|\+| |' | awk '{print $2}' | sort | uniq`
22 addHost=0
23 if [ $# -gt 0 ] ; then if test $1 = '+h' ; then
24 addHost=1 ; shift
25 fi ; fi
26 #echo $MALL
27 if test $# = 0 ; then
28 MACHINES=$MALL
29 else
30 MACHINES=$*
31 fi
32
33 for mname in $MACHINES ; do
34
35 #echo " $mname"
36 printf '== %-30s ======================\n' "$mname :"
37
38 dir_list=`grep $mname ./dir_all`
39 #echo -n "" > ./mlist
40
41 #- re-order dir_list:
42 sub_list=`grep $mname ./dir_all | sed "s/_$YYMM.._/_YYYYMMDD_/g" | sort | uniq`
43 #echo 'sub_list=' $sub_list '<'
44 dir_list=''
45 for i in $sub_list ; do
46 pp=`echo $i | sed 's/_YYYYMMDD_.*$//'`
47 ss=`echo $i | sed 's/^.*_YYYYMMDD_//'`
48 #add=`grep "${pp}_${YYMM}.._${ss}$" ./dir_all`
49 #dir_list="$dir_list $add"
50 dir_list="$dir_list "`grep "${pp}_${YYMM}.._${ss}$" ./dir_all`
51 done
52 #echo 'dir_list=' $dir_list '<'
53
54 for i in $dir_list ; do
55
56 dir=$INDIR"/"$i
57 OPTFILE=
58 if test -r $dir/summary.txt ; then
59 comm=`grep 'OPTFILE=' $dir/summary.txt`
60 eval $comm
61 OPTFILE=${OPTFILE##*/}
62 fi
63 if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then
64 comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`
65 eval $comm
66 OPTFILE=${OPTFILE##*/}
67 fi
68 if test "x$OPTFILE" = x ; then
69 comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`
70 comm=${comm##*#}
71 eval $comm
72 OPTFILE=${OPTFILE##*/}
73 fi
74 if test "x$OPTFILE" = x ; then
75 OPTFILE="not_explicitly_specified"
76 fi
77
78 ADJOINT=0
79 TANGLIN=0
80 OPENAD=0
81 RESTART=0
82 EXTRA=
83 FAST=0
84 DVLP=0
85 MPI=0
86 MTH=0
87 UR4=0
88 HOST=''
89 if test -r $dir/summary.txt ; then
90 ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt`
91 if test "x$ADJOINT" = x1 ; then
92 OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`
93 fi
94 TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt`
95 if test "x$TANGLIN" = x1 ; then
96 OPENAD=`grep -c '^TangLin .* OpenAD' $dir/summary.txt`
97 fi
98 RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
99 FAST=`grep -c "^run: .*testreport.* '*-fast'*" $dir/summary.txt`
100 if test "x$FAST" = x0 ; then
101 FAST=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`
102 fi
103 DVLP=`grep -c "^run: .*testreport.* '*-devel'*" $dir/summary.txt`
104 MPI=`grep -c "^run: .*testreport.* -mpi " $dir/summary.txt`
105 if test "x$MPI" = x0 ; then
106 MPI=`grep -c "^run: .*testreport.* -MPI " $dir/summary.txt`
107 fi
108 MTH=`grep -c "^run: .*testreport.* -mth " $dir/summary.txt`
109 UR4=`grep -c "^run: .*testreport.* -use_r4 " $dir/summary.txt`
110 if test "x$UR4" = x0 ; then
111 UR4=`grep -c "^run: .*testreport.* -ur4 " $dir/summary.txt`
112 fi
113 if test $addHost = 1 ; then
114 HOST=`grep '^on : ' $dir/summary.txt \
115 | awk '{print $4}' | sed 's/\..*$//'`
116 fi
117 fi
118 if test "x$ADJOINT" = x1 ; then
119 kind="adm-TAF" ; order=0
120 if test "x$OPENAD" = x1 ; then kind="adm-OAD" ; order=2 ; fi
121 elif test "x$TANGLIN" = x1 ; then
122 kind="tlm-TAF" ; order=1
123 if test "x$OPENAD" = x1 ; then kind="tlm-OAD" ; order=3 ; fi
124 elif test "x$RESTART" = x0 ; then
125 kind="forward" ; order=4
126 else
127 kind="restart" ; order=5
128 fi
129 if test "x$UR4" = x1 ; then
130 OPTFILE="${OPTFILE}.use_r4"
131 fi
132 if test "x$MPI" = x1 ; then
133 yy=`echo $OPTFILE | grep -c '+mpi'`
134 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
135 fi
136 if test "x$MTH" = x1 ; then
137 yy=`echo $OPTFILE | grep -c '+mth$'`
138 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
139 fi
140 if test "x$FAST" = x1 ; then
141 OPTFILE="${OPTFILE}.fast"
142 fi
143 if test "x$DVLP" = x1 ; then
144 OPTFILE="${OPTFILE}.dvlp"
145 fi
146
147 t_pass="--"
148 t_tot="--"
149 if test -r $dir/summary.txt ; then
150 grep '^[YN] [YN] [YN] [YN]' $dir/summary.txt > ./all_tests 2>/dev/null
151 t_tot=`cat ./all_tests | wc -l | sed -e 's| ||g'`
152 #t_pass=`grep 'pass ' ./all_tests | wc -l | sed -e 's| ||g'`
153 t_pass=`grep '^Y Y Y Y' $dir/summary.txt | grep 'pass ' | wc -l | sed -e 's| ||g'`
154 fi
155 rm -f ./all_tests
156 #echo "${dir##*/} : $t_pass out of $t_tot (of=$OPTFILE , $kind)"
157 if test $OPTFILE = 'sp5-32' -a $kind = 'forward' ; then
158 echo "${dir##*/} : $t_pass out of $t_tot (of=$OPTFILE , $kind)"
159 fi
160
161 #echo "$OPTFILE$kind $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> ./mlist
162 if test $addHost = 1 ; then
163 if [ $t_tot -lt 100 ] ; then
164 printf ' %3i:%2.2i %-40s %s %-40s %s\n' $t_pass $t_tot $i $kind $OPTFILE $HOST
165 else
166 printf ' %3i:%3.3i %-40s %s %-40s %s\n' $t_pass $t_tot $i $kind $OPTFILE $HOST
167 fi
168 else
169 if [ $t_tot -lt 100 ] ; then
170 printf ' %3i:%2.2i %-40s %s %s\n' $t_pass $t_tot $i $kind $OPTFILE
171 else
172 printf ' %3i:%3.3i %-40s %s %s\n' $t_pass $t_tot $i $kind $OPTFILE
173 fi
174 fi
175
176 done
177
178 # helpful for debugging
179 #cat ./mlist
180
181 done
182
183 #rm -f ./mlist
184 rm -f ./dir_all

  ViewVC Help
Powered by ViewVC 1.1.22