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

Annotation of /mitgcm.org/front_content/make_summary

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


Revision 1.60 - (hide annotations) (download)
Wed Jan 20 03:02:49 2010 UTC (15 years, 5 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 edhill 1.1 #! /usr/bin/env bash
2    
3 jmc 1.60 # $Header: /u/gcmpack/mitgcm.org/front_content/make_summary,v 1.59 2010/01/01 21:37:59 jmc Exp $
4 edhill 1.1 #
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 jmc 1.36 CURR_PER=`date +%Y`"_"`date +%m`
23 edhill 1.1 # defaults
24 jmc 1.36 PERIOD=$CURR_PER
25 edhill 1.1
26     # Parse options
27     ac_prev=
28     for ac_option ; do
29 jmc 1.35
30 edhill 1.1 # 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 jmc 1.35
37 edhill 1.1 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
38 jmc 1.35
39 edhill 1.1 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 jmc 1.35
49 edhill 1.1 *)
50     echo "Error: don't understand argument \"$ac_option\""
51     usage
52     ;;
53 jmc 1.35
54 edhill 1.1 esac
55 jmc 1.35
56 edhill 1.1 done
57    
58 jmc 1.35 #INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD"
59 jmc 1.44 #OUTDIR="/home/jmc/mitgcm/test_web/summary"
60 edhill 1.1 INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
61     OUTDIR="/u/u0/httpd/html/testing/summary"
62 jmc 1.35
63 jmc 1.36 OUTFILE=$OUTDIR"/output_"$PERIOD".html"
64 jmc 1.35 res_url="http://mitgcm.org/testing/"
65 edhill 1.1
66 jmc 1.36 # Create the links in $OUTFILE :
67 edhill 1.1 echo "Creating the \"latest\" file for each machine: "
68 edhill 1.5 the_date=`date`
69 edhill 1.1
70 jmc 1.60 sed "s/_PERIOD/$PERIOD/" summary_head > $OUTFILE
71     cat <<EOF >>$OUTFILE
72 edhill 1.1 <table align="center" cellpadding="0" cellspacing="0" border="0" width="95%">
73     <tr bgcolor="#00cccc">
74 edhill 1.4 <td height="0"> <b>Nickname</b> </td>
75 edhill 1.1 <td> <b>OPTFILE Name</b> </td>
76 edhill 1.4 <td> <b>Type</b> </td>
77 edhill 1.5 <td> <b>Date</b> </td>
78 edhill 1.4 <td> <b>Summary</b> </td>
79 edhill 1.6 <td> <b>Ratio</b> </td>
80 edhill 1.1 </tr>
81    
82     EOF
83    
84     color="#bbffdd"
85 edhill 1.10 ncolor="#bbddff"
86 edhill 1.1
87 jmc 1.51 MACHINES="faulks meander lagoon harbor dickens danton aces"
88 jmc 1.60 MACHINES="$MACHINES beagle columbia pleiades iblade rays solssrv solasrv sx8"
89 jmc 1.51 MACHINES="$MACHINES bigred starp"
90 edhill 1.1
91 jmc 1.34 ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all
92 edhill 1.1
93 edhill 1.20 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 jmc 1.35 #MACHINES="faulks"
105 edhill 1.20
106 edhill 1.1 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 edhill 1.3 comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`
124 edhill 1.1 eval $comm
125     OPTFILE=${OPTFILE##*/}
126     fi
127     if test "x$OPTFILE" = x ; then
128 edhill 1.21 comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`
129 edhill 1.3 comm=${comm##*#}
130 edhill 1.1 eval $comm
131     OPTFILE=${OPTFILE##*/}
132     fi
133     if test "x$OPTFILE" = x ; then
134     OPTFILE="not_explicitly_specified"
135     fi
136 edhill 1.4
137     ADJOINT=
138 jmc 1.32 RESTART=0
139 jmc 1.42 NOI3E=0
140 jmc 1.49 MTH=0
141 edhill 1.4 if test -r $dir/summary.txt ; then
142     comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`
143     eval $comm
144 jmc 1.32 RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
145 jmc 1.54 NOI3E=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`
146 jmc 1.49 MTH=`grep -c "^run: .*testreport.* -mth " $dir/summary.txt`
147 edhill 1.4 fi
148 jmc 1.32 if test "x$RESTART" = x0 ; then
149 edhill 1.4 kind="forward"
150 jmc 1.32 test "x$ADJOINT" = xtrue && kind="adjoint"
151 edhill 1.4 else
152 jmc 1.32 kind="restart"
153 edhill 1.4 fi
154 jmc 1.55 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 jmc 1.42 if test "x$NOI3E" = x1 ; then
159     OPTFILE="${OPTFILE}.noieee"
160     fi
161 edhill 1.4
162 edhill 1.6 t_pass="--"
163     t_tot="--"
164     if test -r $dir/summary.txt ; then
165 jmc 1.30 grep '^[YN] [YN] [YN] [YN]' $dir/summary.txt > ./all_tests 2>/dev/null
166 edhill 1.6 t_tot=`cat ./all_tests | wc -l | sed -e 's| ||g'`
167 jmc 1.38 t_pass=`grep '^Y Y Y Y' ./all_tests | grep 'pass ' | wc -l | sed -e 's| ||g'`
168 edhill 1.6 fi
169 jmc 1.30 rm -f ./all_tests
170 edhill 1.6 # echo "${dir##*/} : $t_pass out of $t_tot"
171    
172 edhill 1.1 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 jmc 1.59 DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,2)=="20")'`
178 edhill 1.1 rm -f ./ms_tmp
179 edhill 1.4
180 edhill 1.6 echo "$OPTFILE$kind $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> ./mlist
181 edhill 1.1
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 edhill 1.10
191     # swap colors
192     ctmp=$color
193     color=$ncolor
194     ncolor=$ctmp
195    
196 edhill 1.4 keys=`cat ./mlist | cut -d " " -f 1 | sort | uniq`
197 edhill 1.1
198 edhill 1.4 for key in $keys ; do
199 edhill 1.17 tline=`grep "^$key " ./mlist | head -1`
200 edhill 1.6 ratio=`echo $tline | cut -d " " -f 6`
201 edhill 1.4 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 edhill 1.1 URL="results/$PERIOD/$ldir"
206 jmc 1.36 cat <<EOF >>$OUTFILE
207 edhill 1.1 <tr bgcolor="$color">
208 edhill 1.4 <td height="0"> $mname </td>
209 edhill 1.1 <td> $optf </td>
210 edhill 1.4 <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 edhill 1.6 <td> $ratio </td>
214 edhill 1.1 </tr>
215     EOF
216     done
217     fi
218    
219     done
220    
221 jmc 1.36 cat >> $OUTFILE << EOF
222 edhill 1.5 <tr bgcolor="#00cccc">
223 edhill 1.6 <td height="0" colspan="6" align="center" >This table generated on: $the_date</td>
224     </tr>
225 edhill 1.1
226     </table>
227 edhill 1.6
228 edhill 1.26 <p>Examples of the scripts used for these testing runs can be obtained from: <a
229 jmc 1.60 href="http://mitgcm.org/viewvc/MITgcm/MITgcm/tools/example_scripts/">
230 edhill 1.26 MITgcm/tools/example_scripts</a>.</p>
231 edhill 1.6
232    
233 edhill 1.1 </body>
234     </html>
235    
236     EOF
237    
238     rm -f ./dir_all ./mlist
239    
240 jmc 1.36 #- 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 edhill 1.1 if test "x$PERIOD" = "x$CURR_PER" ; then
247 edhill 1.2 cp $LATEST ./testing.xml
248 edhill 1.1 (
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