/[MITgcm]/mitgcm.org/front_content/make_summary
ViewVC logotype

Contents of /mitgcm.org/front_content/make_summary

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


Revision 1.60 - (show annotations) (download)
Wed Jan 20 03:02:49 2010 UTC (15 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.59: +5 -136 lines
put the 1rst table (platform description) in separated file "summary_head"
 + update table and fix link to MITgcm source code (tools/example_scripts).

1 #! /usr/bin/env bash
2
3 # $Header: /u/gcmpack/mitgcm.org/front_content/make_summary,v 1.59 2010/01/01 21:37:59 jmc Exp $
4 #
5 # The purpose of this script is to create HTML summaries of the
6 # directories produced by the "parse_emails" script.
7
8
9 usage()
10 {
11 echo
12 echo "Usage: $0 [OPTIONS]"
13 echo
14 echo "where possible OPTIONS are:"
15 echo " (-help|-h) print usage"
16 echo " (-date |-d )PERIOD run for PERIOD=\"YYYY_MM\""
17 echo " [def=\"$PERIOD\"]"
18 echo
19 exit 1
20 }
21
22 CURR_PER=`date +%Y`"_"`date +%m`
23 # defaults
24 PERIOD=$CURR_PER
25
26 # Parse options
27 ac_prev=
28 for ac_option ; do
29
30 # If the previous option needs an argument, assign it.
31 if test -n "$ac_prev"; then
32 eval "$ac_prev=\$ac_option"
33 ac_prev=
34 continue
35 fi
36
37 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
38
39 case $ac_option in
40
41 -help | --help | -h | --h)
42 usage ;;
43
44 -date | --date | -d | --d)
45 ac_prev=PERIOD ;;
46 --date=* | -date=*)
47 PERIOD=$ac_optarg ;;
48
49 *)
50 echo "Error: don't understand argument \"$ac_option\""
51 usage
52 ;;
53
54 esac
55
56 done
57
58 #INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD"
59 #OUTDIR="/home/jmc/mitgcm/test_web/summary"
60 INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
61 OUTDIR="/u/u0/httpd/html/testing/summary"
62
63 OUTFILE=$OUTDIR"/output_"$PERIOD".html"
64 res_url="http://mitgcm.org/testing/"
65
66 # Create the links in $OUTFILE :
67 echo "Creating the \"latest\" file for each machine: "
68 the_date=`date`
69
70 sed "s/_PERIOD/$PERIOD/" summary_head > $OUTFILE
71 cat <<EOF >>$OUTFILE
72 <table align="center" cellpadding="0" cellspacing="0" border="0" width="95%">
73 <tr bgcolor="#00cccc">
74 <td height="0"> <b>Nickname</b> </td>
75 <td> <b>OPTFILE Name</b> </td>
76 <td> <b>Type</b> </td>
77 <td> <b>Date</b> </td>
78 <td> <b>Summary</b> </td>
79 <td> <b>Ratio</b> </td>
80 </tr>
81
82 EOF
83
84 color="#bbffdd"
85 ncolor="#bbddff"
86
87 MACHINES="faulks meander lagoon harbor dickens danton aces"
88 MACHINES="$MACHINES beagle columbia pleiades iblade rays solssrv solasrv sx8"
89 MACHINES="$MACHINES bigred starp"
90
91 ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all
92
93 MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`
94 for madd in $MALL ; do
95 present=0
96 for m in $MACHINES ; do
97 echo $madd | grep $m > /dev/null 2>&1
98 RETVAL=$?
99 test $RETVAL = 0 && present=1
100 continue
101 done
102 test $present = 0 && MACHINES="$MACHINES $madd"
103 done
104 #MACHINES="faulks"
105
106 for mname in $MACHINES ; do
107
108 echo " $mname"
109
110 dir_list=`grep $mname ./dir_all`
111 echo -n "" > ./mlist
112
113 for i in $dir_list ; do
114
115 dir=$INDIR"/"$i
116 OPTFILE=
117 if test -r $dir/summary.txt ; then
118 comm=`grep 'OPTFILE=' $dir/summary.txt`
119 eval $comm
120 OPTFILE=${OPTFILE##*/}
121 fi
122 if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then
123 comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`
124 eval $comm
125 OPTFILE=${OPTFILE##*/}
126 fi
127 if test "x$OPTFILE" = x ; then
128 comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`
129 comm=${comm##*#}
130 eval $comm
131 OPTFILE=${OPTFILE##*/}
132 fi
133 if test "x$OPTFILE" = x ; then
134 OPTFILE="not_explicitly_specified"
135 fi
136
137 ADJOINT=
138 RESTART=0
139 NOI3E=0
140 MTH=0
141 if test -r $dir/summary.txt ; then
142 comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`
143 eval $comm
144 RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
145 NOI3E=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`
146 MTH=`grep -c "^run: .*testreport.* -mth " $dir/summary.txt`
147 fi
148 if test "x$RESTART" = x0 ; then
149 kind="forward"
150 test "x$ADJOINT" = xtrue && kind="adjoint"
151 else
152 kind="restart"
153 fi
154 if test "x$MTH" = x1 ; then
155 yy=`echo $OPTFILE | grep -c '+mth$'`
156 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
157 fi
158 if test "x$NOI3E" = x1 ; then
159 OPTFILE="${OPTFILE}.noieee"
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 '^Y Y Y Y' ./all_tests | grep 'pass ' | wc -l | sed -e 's| ||g'`
168 fi
169 rm -f ./all_tests
170 # echo "${dir##*/} : $t_pass out of $t_tot"
171
172 tokens=`echo $i | sed -e 's|_| |g'`
173 echo "" > ./ms_tmp
174 for tok in $tokens ; do
175 echo $tok >> ./ms_tmp
176 done
177 DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,2)=="20")'`
178 rm -f ./ms_tmp
179
180 echo "$OPTFILE$kind $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> ./mlist
181
182 done
183
184 # helpful for debugging
185 # cat ./mlist
186
187 # Do we have any data? If so, create the latest pointer.
188 num=`wc -l ./mlist | awk '{print $1}'`
189 if test $num -gt 0 ; then
190
191 # swap colors
192 ctmp=$color
193 color=$ncolor
194 ncolor=$ctmp
195
196 keys=`cat ./mlist | cut -d " " -f 1 | sort | uniq`
197
198 for key in $keys ; do
199 tline=`grep "^$key " ./mlist | head -1`
200 ratio=`echo $tline | cut -d " " -f 6`
201 ldir=`echo $tline | cut -d " " -f 5`
202 kind=`echo $tline | cut -d " " -f 4`
203 optf=`echo $tline | cut -d " " -f 3`
204 DAY=`echo $tline | cut -d " " -f 2`
205 URL="results/$PERIOD/$ldir"
206 cat <<EOF >>$OUTFILE
207 <tr bgcolor="$color">
208 <td height="0"> $mname </td>
209 <td> $optf </td>
210 <td> $kind </td>
211 <td> <a href="$res_url$URL">$DAY</a> </td>
212 <td> <a href="$res_url$URL/summary.txt"> summary.txt </a> </td>
213 <td> $ratio </td>
214 </tr>
215 EOF
216 done
217 fi
218
219 done
220
221 cat >> $OUTFILE << EOF
222 <tr bgcolor="#00cccc">
223 <td height="0" colspan="6" align="center" >This table generated on: $the_date</td>
224 </tr>
225
226 </table>
227
228 <p>Examples of the scripts used for these testing runs can be obtained from: <a
229 href="http://mitgcm.org/viewvc/MITgcm/MITgcm/tools/example_scripts/">
230 MITgcm/tools/example_scripts</a>.</p>
231
232
233 </body>
234 </html>
235
236 EOF
237
238 rm -f ./dir_all ./mlist
239
240 #- put the file in place
241 chgrp gcmpack $OUTFILE
242 chmod 664 $OUTFILE
243 LATEST=$OUTDIR"/latest_"$PERIOD".html"
244 mv -f $OUTFILE $LATEST
245
246 if test "x$PERIOD" = "x$CURR_PER" ; then
247 cp $LATEST ./testing.xml
248 (
249 cd $OUTDIR
250 rm -f latest.html
251 ln -s $LATEST latest.html
252 )
253 fi

  ViewVC Help
Powered by ViewVC 1.1.22