/[MITgcm]/MITgcm_contrib/test_scripts/faulks/make_summary
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/faulks/make_summary

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


Revision 1.6 - (hide annotations) (download)
Sun Dec 7 04:24:37 2003 UTC (22 years, 9 months ago) by edhill
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
 o remove

1 edhill 1.1 #!/bin/bash
2    
3 edhill 1.6 # $Header: /u/u3/gcmpack/MITgcm_contrib/test_scripts/faulks/make_summary,v 1.5 2003/12/06 19:08:51 edhill Exp $
4 edhill 1.1
5     # Ed Hill
6    
7     # The purpose of this script is to create HTML summaries of the
8     # directories produced by the "parse_emails" script.
9    
10    
11     usage()
12     {
13     echo
14     echo "Usage: $0 [OPTIONS]"
15     echo
16     echo "where possible OPTIONS are:"
17     echo " (-help|-h) print usage"
18     echo " (-date |-d )PERIOD run for PERIOD=\"YYYY_MM\""
19     echo " [def=\"$PERIOD\"]"
20     echo
21     exit 1
22     }
23    
24     # defaults
25     PERIOD=`date +%Y`"_"`date +%m`
26    
27     # Parse options
28     ac_prev=
29     for ac_option ; do
30    
31     # If the previous option needs an argument, assign it.
32     if test -n "$ac_prev"; then
33     eval "$ac_prev=\$ac_option"
34     ac_prev=
35     continue
36     fi
37    
38     ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
39    
40     case $ac_option in
41    
42     -help | --help | -h | --h)
43     usage ;;
44    
45     -date | --date | -d | --d)
46     ac_prev=PERIOD ;;
47     --date=* | -date=*)
48     PERIOD=$ac_optarg ;;
49    
50     *)
51     echo "Error: don't understand argument \"$ac_option\""
52     usage
53     ;;
54    
55     esac
56    
57     done
58    
59     INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
60     OUTDIR="/u/u0/httpd/html/testing/summary"
61     OUTFILE=$OUTDIR"/summary_"$PERIOD".html"
62    
63    
64     # Create the summary file for $PERIOD
65     echo -n "Creating the summary file for the period \"$PERIOD\" ... "
66     cat > $OUTFILE << EOF
67     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
68     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
69    
70     <html xmlns="http://www.w3.org/1999/xhtml">
71     <head>
72     <title>MITgcm testing summary</title>
73     <meta name="author" content="Ed Hill" />
74     <base href="http://mitgcm.org/testing/summary/" />
75     </head>
76     <body>
77     <table cellpadding="0" cellspacing="0" border="0" width="100%">
78    
79     EOF
80    
81     # all_files=`find $INDIR -name summary.txt`
82     all_files=`( cd $INDIR ; find . -name summary.txt )`
83    
84     for f in $all_files ; do
85    
86     file=$INDIR"/"${f/.\//}
87     grep "^fresults" $file > /dev/null 2>&1
88     RETVAL=$?
89     if test "x$RETVAL" != x0 ; then
90     continue
91     fi
92    
93     url=`echo $file | sed -e 's|/u/edhill/www|http://mitgcm.org/~edhill|'`
94     url=`echo $url | sed -e 's|summary.txt||'`
95     MACH=
96     fresults=
97     color="#eeeeee"
98    
99     source $file
100     echo $fresults | grep FAIL > /dev/null 2>&1
101     if test "x$?" = x0 ; then
102     color="#ff99ff"
103     fi
104     echo $fresults | grep pass > /dev/null 2>&1
105     if test "x$?" = x0 ; then
106     color="#99ffff"
107     fi
108    
109     gm_state=`echo $file | sed -e 's/summary.txt/genmake_state/g'`
110     if test -r $gm_state ; then
111     grep '^OPTFILE=' $gm_state > ./tmp_state
112     source ./tmp_state
113     else
114     optfile="unknown"
115     fi
116     optfile=`echo $OPTFILE | awk -F '/' '{print $NF}'`
117    
118     echo "<tr bgcolor=\"$color\">" >> $OUTFILE
119     echo "<td height=\"0\">$MACH</td>" >> $OUTFILE
120     echo "<td><a href=\"$url\">$DATE</a></td>" >> $OUTFILE
121     for i in $fresults ; do
122     if test "x$i" = xN ; then
123     echo -n "<td bgcolor=\"#ff6666\">$i</td>" >> $OUTFILE
124     else
125     echo -n "<td>$i</td>" >> $OUTFILE
126     fi
127     done
128     echo "<td>$optfile</td>" >> $OUTFILE
129     echo "</tr>" >> $OUTFILE
130    
131     done
132    
133     cat >> $OUTFILE << EOF
134    
135     </table>
136     </body>
137     </html>
138    
139     EOF
140    
141     chmod a+r $OUTFILE
142     echo "done"
143    
144    
145     # Create the "latest" links
146     echo "Creating the \"latest\" file for each machine: "
147     LATEST=$OUTDIR"/latest_"$PERIOD".html"
148     cat > $LATEST << EOF
149     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
150     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
151    
152     <html xmlns="http://www.w3.org/1999/xhtml">
153     <head>
154     <title>MITgcm testing summary</title>
155     <meta name="author" content="Ed Hill" />
156     <base href="http://mitgcm.org/testing/summary/" />
157     </head>
158     <body>
159     <p>The following are the most recent MITgcm testing runs for the
160     time period <b>$PERIOD</b>.<br /><br />
161     The machine naming scheme is:<br /></p>
162     <table align="center" border="0">
163     <tr bgcolor="#00cccc"> <td><b>Machine</b></td> <td><b>"Nickname"</b></td>
164     <td><b>Notes</b></td> </tr>
165 edhill 1.5
166 edhill 1.1 <tr bgcolor="#bbffdd"> <td>faulks.lcs.mit.edu</td> <td>"faulks"</td>
167 edhill 1.5 <td>Red Hat 7.3 on an Intel P4 (the "original" testing machine)</td> </tr>
168 edhill 1.1 <tr bgcolor="#bbddff"> <td>shelley.lcs.mit.edu</td> <td>"shelley"</td>
169 edhill 1.5 <td>Red Hat 9 on an Intel P4</td> </tr>
170    
171 edhill 1.1 <tr bgcolor="#bbffdd"> <td>cg01.lcs.mit.edu cluster</td> <td>"myrinet"</td>
172 edhill 1.5 <td><a href="http://mitgcm.org/projects/MITGCM_CLUSTER/">MITgcm cluster facility
173     </a></td> </tr>
174     <tr bgcolor="#bbddff"> <td>Alpha cluster</td> <td>"halem"</td>
175     <td><a href="http://webserv.gsfc.nasa.gov/SCB/NCCS/systems/high-end-computing.html">
176     NASA NCCS Halem</a></td> </tr>
177    
178     <tr bgcolor="#bbffdd"> <td> SGI Origin 2000 </td> <td>"hopper"</td>
179     <td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O2K/o2k.html">
180     NAS SGI Origin 2000 </a></td> </tr>
181     <tr bgcolor="#bbddff"> <td> SGI Origin 3000 </td> <td>"lomax"</td>
182     <td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O3K/o3k.html">
183     NAS SGI Origin 3000 </a></td> </tr>
184    
185     <tr bgcolor="#bbffdd"> <td> SGI Altix </td> <td>"orion"</td>
186     <td><a href="http://sc.jpl.nasa.gov/">JPL Supercomputing and
187     Visualization Facility</a></td> </tr>
188     <tr bgcolor="#bbddff"> <td> IBM POWER3 SP cluster </td> <td>"bf"</td>
189     <td><a href="http://www.scd.ucar.edu/computers/blackforest/">NCAR Blackforest
190     </a></td> </tr>
191    
192     <tr bgcolor="#bbffdd"> <td> IBM POWER4 SP cluster </td> <td>"bs"</td>
193     <td><a href="http://www.scd.ucar.edu/computers/bluesky/">NCAR Bluesky
194     </a></td> </tr>
195    
196     <!--
197     <tr bgcolor="#bbddff"> <td> </td> <td>""</td>
198 edhill 1.1 <td></td> </tr>
199     -->
200 edhill 1.5
201 edhill 1.1 </table>
202     <br />
203 edhill 1.5 <table align="center" cellpadding="0" cellspacing="0" border="0" width="95%">
204 edhill 1.1 <tr bgcolor="#00cccc">
205     <td height="0"> <b>"Nickname"</b> </td>
206     <td> <b>OPTFILE Name</b> </td>
207     <td> <b>Date (YYYYMMDD)</b> </td>
208     </tr>
209    
210     EOF
211    
212     color="#bbffdd"
213    
214 edhill 1.4 MACHINES="faulks shelley myrinet halem hopper lomax orion bf bs"
215 edhill 1.1
216     ( cd $INDIR ; ls -1 ) > ./dir_all
217    
218     for mname in $MACHINES ; do
219    
220     echo " $mname"
221     if test "x$color" = x#bbffdd ; then
222     color="#bbddff"
223     else
224     color="#bbffdd"
225     fi
226    
227     dir_list=`grep $mname ./dir_all`
228     echo -n "" > ./mlist
229    
230     for i in $dir_list ; do
231    
232     dir=$INDIR"/"$i
233     OPTFILE=
234     if test -r $dir/summary.txt ; then
235     comm=`grep 'OPTFILE=' $dir/summary.txt`
236     eval $comm
237     OPTFILE=${OPTFILE##*/}
238     fi
239     if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then
240     comm=`grep 'OPTFILE=' $dir/genmake_state`
241     eval $comm
242     OPTFILE=${OPTFILE##*/}
243     fi
244 edhill 1.2 if test "x$OPTFILE" = x ; then
245 edhill 1.5 comm=`grep '^# OPTFILE=' $dir/*/Makefile 2>/dev/null | head -1 | sed -e 's|^# ||'`
246 edhill 1.2 eval $comm
247     OPTFILE=${OPTFILE##*/}
248     fi
249     if test "x$OPTFILE" = x ; then
250 edhill 1.5 OPTFILE="not_explicitly_specified"
251 edhill 1.2 fi
252 edhill 1.3 tokens=`echo $i | sed -e 's|_| |g'`
253     echo "" > ./ms_tmp
254 edhill 1.5 for tok in $tokens ; do
255     echo $tok >> ./ms_tmp
256 edhill 1.3 done
257     DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,3)=="200")'`
258     rm -f ./ms_tmp
259 edhill 1.1 echo "$OPTFILE $DAY $i" >> ./mlist
260    
261     done
262 edhill 1.2
263     # helpful for debugging
264     # cat ./mlist
265 edhill 1.1
266     # Do we have any data? If so, create the latest pointer.
267     num=`wc -l ./mlist | awk '{print $1}'`
268     if test $num -gt 0 ; then
269     optfiles=`cat ./mlist | cut -d " " -f 1 | sort | uniq`
270    
271 edhill 1.5 for optf in $optfiles ; do
272     ldir=`grep "^$optf " ./mlist | sort -r | head -1 | cut -d " " -f 3`
273 edhill 1.1 URL="../results/$PERIOD/$ldir"
274     cat <<EOF >>$LATEST
275     <tr bgcolor="$color">
276     <td height="0"><a href="$URL"> $mname </a></td>
277 edhill 1.5 <td> $optf </td>
278 edhill 1.1 <td> $DAY </td>
279     </tr>
280     EOF
281     done
282     fi
283    
284     done
285    
286     cat >> $LATEST << EOF
287    
288     </table>
289     </body>
290     </html>
291    
292     EOF
293    
294     rm -f ./dir_all ./mlist
295    
296     CURR_PER=`date +%Y`"_"`date +%m`
297     if test "x$PERIOD" = "x$CURR_PER" ; then
298     (
299     cd $OUTDIR
300     rm -f latest.html
301     ln -s $LATEST latest.html
302     # cd ..
303     # rm -f latest.html
304     # ln -s summary/latest.html latest.html
305     )
306     fi

  ViewVC Help
Powered by ViewVC 1.1.22