1 |
#! /usr/bin/env bash |
2 |
|
3 |
# $Header: /u/gcmpack/mitgcm.org/front_content/make_summary,v 1.34 2007/12/25 22:01:48 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 |
# defaults |
23 |
PERIOD=`date +%Y`"_"`date +%m` |
24 |
|
25 |
# Parse options |
26 |
ac_prev= |
27 |
for ac_option ; do |
28 |
|
29 |
# If the previous option needs an argument, assign it. |
30 |
if test -n "$ac_prev"; then |
31 |
eval "$ac_prev=\$ac_option" |
32 |
ac_prev= |
33 |
continue |
34 |
fi |
35 |
|
36 |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
37 |
|
38 |
case $ac_option in |
39 |
|
40 |
-help | --help | -h | --h) |
41 |
usage ;; |
42 |
|
43 |
-date | --date | -d | --d) |
44 |
ac_prev=PERIOD ;; |
45 |
--date=* | -date=*) |
46 |
PERIOD=$ac_optarg ;; |
47 |
|
48 |
*) |
49 |
echo "Error: don't understand argument \"$ac_option\"" |
50 |
usage |
51 |
;; |
52 |
|
53 |
esac |
54 |
|
55 |
done |
56 |
|
57 |
#INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD" |
58 |
INDIR="/u/u0/httpd/html/testing/results/$PERIOD" |
59 |
OUTDIR="/u/u0/httpd/html/testing/summary" |
60 |
|
61 |
OUTFILE=$OUTDIR"/summary_"$PERIOD".html" |
62 |
res_url="http://mitgcm.org/testing/" |
63 |
|
64 |
# Create the "latest" links |
65 |
echo "Creating the \"latest\" file for each machine: " |
66 |
LATEST=$OUTDIR"/latest_"$PERIOD".html" |
67 |
the_date=`date` |
68 |
cat > $LATEST << EOF |
69 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
70 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
71 |
|
72 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
73 |
<head> |
74 |
<title>MITgcm testing summary</title> |
75 |
<meta name="author" content="Ed Hill" /> |
76 |
|
77 |
<!-- <base href="http://mitgcm.org/testing/summary/" /> --> |
78 |
|
79 |
<!-- Hinting for menu generation --> |
80 |
<meta name="add_name_0" content="Testing" /> |
81 |
<meta name="add_name_1" content="" /> |
82 |
<meta name="add_name_2" content="" /> |
83 |
<meta name="add_title" content="Testing" /> |
84 |
<!-- Hinting for menu generation --> |
85 |
|
86 |
</head> |
87 |
<body> |
88 |
<p>The MITgcm model is tested |
89 |
(compiled and run) in an automated fashion on a varirety of |
90 |
different machines. The following is a summary of the MITgcm |
91 |
verification suite for the time period: <b>$PERIOD</b>.</p> |
92 |
|
93 |
<p>The machine naming scheme is:<br /></p> |
94 |
<table align="center" cellpadding="0" border="0"> |
95 |
<tr bgcolor="#00cccc"> <td><b>Machine Type</b></td> <td><b>Nickname</b></td> |
96 |
<td><b>Notes</b></td> </tr> |
97 |
|
98 |
<tr bgcolor="#bbddff"> <td>Intel P4</td> <td>"faulks"</td> |
99 |
<td>Fedora Core 6 </td> </tr> |
100 |
<tr bgcolor="#bbffdd"> <td> Intel P4</td> <td>"eddy"</td> |
101 |
<td>Fedora Core 5</td> </tr> |
102 |
<tr bgcolor="#bbddff"> <td> Intel P4 </td> <td>"bay"</td> |
103 |
<td>Fedora Core 5 </td> </tr> |
104 |
<tr bgcolor="#bbffdd"> <td> Intel P4 </td> <td>"meander"</td> |
105 |
<td>Fedora Core 7 </td> </tr> |
106 |
|
107 |
<tr bgcolor="#bbddff"> <td> <a href="http://acesgrid.org">ACESgrid Dell |
108 |
Xeon</a> </td> <td>"aces"</td><td>Fedora Core 2</td> </tr> |
109 |
|
110 |
<!-- |
111 |
<tr bgcolor="#bbffdd"> <td> Intel P3/P4 Beowulf </td> <td>"myrinet"</td> |
112 |
<td><a href="http://mitgcm.org/projects/MITGCM_CLUSTER/">MITgcm cluster |
113 |
facility </a></td> </tr> |
114 |
<tr bgcolor="#bbddff"> <td>Alpha cluster</td> <td>"halem"</td> |
115 |
<td><a href="http://nccstag.gsfc.nasa.gov/halem/quickstart_halem.html"> |
116 |
NASA NCCS Halem</a></td> </tr> |
117 |
--> |
118 |
|
119 |
<!-- |
120 |
<tr bgcolor="#bbffdd"> <td> SGI Origin 2000 </td> <td>"hopper"</td> |
121 |
<td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O2K/o2k.html"> |
122 |
NAS SGI Origin 2000 </a></td> </tr> |
123 |
<tr bgcolor="#bbddff"> <td> SGI Origin 3000</td><td>"lomax"/"turing"</td> |
124 |
<td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O3K/o3k.html"> |
125 |
NAS SGI Origin 3000 </a></td> </tr> |
126 |
--> |
127 |
|
128 |
<tr bgcolor="#bbffdd"> <td> SGI Altix Cluster </td> <td>"columbia"</td> |
129 |
<td><a href="http://www.nas.nasa.gov/Resources/Systems/columbia.html"> |
130 |
NAS Columbia </a></td> </tr> |
131 |
|
132 |
<!-- |
133 |
<tr bgcolor="#bbffdd"> <td> SGI Altix 350 </td> <td>"altix350"</td> |
134 |
<td><a href="http://acesgrid.org/geocluster/">MIT ACESgrid |
135 |
GeoCluster</a></td> </tr> |
136 |
<tr bgcolor="#bbddff"> <td> IBM POWER3 SP </td> <td>"bf"</td> |
137 |
<td><a href="http://www.scd.ucar.edu/computers/blackforest/">NCAR Blackforest |
138 |
</a></td> </tr> |
139 |
<tr bgcolor="#bbffdd"> <td> IBM/Apple dual G5 </td> <td>"two"</td> |
140 |
<td>Mac OSX 10.3 (gcc 3.4) </td> </tr> |
141 |
--> |
142 |
<tr bgcolor="#bbddff"> <td> IBM POWER4 SP </td> <td>"edvir"</td> |
143 |
<td> AIX 5.2 </td> </tr> |
144 |
<tr bgcolor="#bbffdd"> <td> IBM POWER5+ SP </td> <td>"blueice"</td> |
145 |
<td><a href="http://www.scd.ucar.edu/computers/blueice/">NCAR Blueice |
146 |
</a></td> </tr> |
147 |
|
148 |
<tr bgcolor="#bbddff"> <td> AMD Opteron </td> <td>"batsi"</td> |
149 |
<td>Fedora Core 4 (AMD64)</td> </tr> |
150 |
<tr bgcolor="#bbffdd"> <td> AMD Opteron </td> <td>"starp"</td> |
151 |
<td>SuSE SLES 10 (AMD64)</td> </tr> |
152 |
|
153 |
<tr bgcolor="#bbddff"> <td> Sun UltraSparc IV </td> <td>"rays1"</td> |
154 |
<td>Solaris 9</td> </tr> |
155 |
<tr bgcolor="#bbffdd"> <td> Sun UltraSparc IV </td> <td>"model"</td> |
156 |
<td>Solaris 9</td> </tr> |
157 |
<tr bgcolor="#bbddff"> <td> Cray XD1 (AMD Opteron) </td> <td>"xd1"</td> |
158 |
<td>Cray HPC enhanced Linux 2.6.5 </td> </tr> |
159 |
<tr bgcolor="#bbffdd"> <td> PowerPC970MP cluster </td> <td>"bigred"</td> |
160 |
<td>SuSE SLES 9 (PPC) </td> </tr> |
161 |
|
162 |
<tr bgcolor="#bbddff"> <td><a |
163 |
href="http://www.testdrive.hp.com/current.shtml"> HP test-drive </a> |
164 |
(Pentium III) </td> <td>"td152"</td> <td> FreeBSD 6.2 </td> </tr> |
165 |
<tr bgcolor="#bbffdd"> <td><a |
166 |
href="http://www.testdrive.hp.com/current.shtml"> HP test-drive </a> |
167 |
(Itanium II) </td> <td>"td187"</td> <td>SuSE SLES 10 </td> </tr> |
168 |
<tr bgcolor="#bbddff"> <td><a |
169 |
href="http://www.testdrive.hp.com/current.shtml"> HP test-drive </a> |
170 |
(PA-RISC 8700) </td> <td>"td192"</td> <td> HP-UX 11i 11.11 </td> </tr> |
171 |
<tr bgcolor="#bbffdd"> <td><a |
172 |
href="http://www.testdrive.hp.com/current.shtml"> HP test-drive </a> |
173 |
(Itanium II) </td> <td>"td194"</td> <td> HP-UX 11i v3 </td> </tr> |
174 |
|
175 |
<!-- |
176 |
<tr bgcolor="#bbddff"> <td> </td> <td>""</td> |
177 |
<td></td> </tr> |
178 |
--> |
179 |
|
180 |
</table> |
181 |
|
182 |
<p><br /> |
183 |
The complete output for the verification runs can be found in |
184 |
<a href="http://mitgcm.org/testing/summary/">the summary pages</a> |
185 |
and the <a href="http://mitgcm.org/testing/results/">testing archives</a>. |
186 |
The latest reports are:</p> |
187 |
<table align="center" cellpadding="0" cellspacing="0" border="0" width="95%"> |
188 |
<tr bgcolor="#00cccc"> |
189 |
<td height="0"> <b>Nickname</b> </td> |
190 |
<td> <b>OPTFILE Name</b> </td> |
191 |
<td> <b>Type</b> </td> |
192 |
<td> <b>Date</b> </td> |
193 |
<td> <b>Summary</b> </td> |
194 |
<td> <b>Ratio</b> </td> |
195 |
</tr> |
196 |
|
197 |
EOF |
198 |
|
199 |
color="#bbffdd" |
200 |
ncolor="#bbddff" |
201 |
|
202 |
MACHINES="faulks aces eddy bay meander" |
203 |
MACHINES="$MACHINES edvir rays1 model columbia" |
204 |
MACHINES="$MACHINES xd1 batsi starp" |
205 |
|
206 |
( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all |
207 |
|
208 |
MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq` |
209 |
for madd in $MALL ; do |
210 |
present=0 |
211 |
for m in $MACHINES ; do |
212 |
echo $madd | grep $m > /dev/null 2>&1 |
213 |
RETVAL=$? |
214 |
test $RETVAL = 0 && present=1 |
215 |
continue |
216 |
done |
217 |
test $present = 0 && MACHINES="$MACHINES $madd" |
218 |
done |
219 |
#MACHINES="faulks" |
220 |
|
221 |
for mname in $MACHINES ; do |
222 |
|
223 |
echo " $mname" |
224 |
|
225 |
dir_list=`grep $mname ./dir_all` |
226 |
echo -n "" > ./mlist |
227 |
|
228 |
for i in $dir_list ; do |
229 |
|
230 |
dir=$INDIR"/"$i |
231 |
OPTFILE= |
232 |
if test -r $dir/summary.txt ; then |
233 |
comm=`grep 'OPTFILE=' $dir/summary.txt` |
234 |
eval $comm |
235 |
OPTFILE=${OPTFILE##*/} |
236 |
fi |
237 |
if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then |
238 |
comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null` |
239 |
eval $comm |
240 |
OPTFILE=${OPTFILE##*/} |
241 |
fi |
242 |
if test "x$OPTFILE" = x ; then |
243 |
comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1` |
244 |
comm=${comm##*#} |
245 |
eval $comm |
246 |
OPTFILE=${OPTFILE##*/} |
247 |
fi |
248 |
if test "x$OPTFILE" = x ; then |
249 |
OPTFILE="not_explicitly_specified" |
250 |
fi |
251 |
|
252 |
ADJOINT= |
253 |
RESTART=0 |
254 |
if test -r $dir/summary.txt ; then |
255 |
comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null` |
256 |
eval $comm |
257 |
RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt` |
258 |
fi |
259 |
if test "x$RESTART" = x0 ; then |
260 |
kind="forward" |
261 |
test "x$ADJOINT" = xtrue && kind="adjoint" |
262 |
else |
263 |
kind="restart" |
264 |
fi |
265 |
|
266 |
t_pass="--" |
267 |
t_tot="--" |
268 |
if test -r $dir/summary.txt ; then |
269 |
grep '^[YN] [YN] [YN] [YN]' $dir/summary.txt > ./all_tests 2>/dev/null |
270 |
t_tot=`cat ./all_tests | wc -l | sed -e 's| ||g'` |
271 |
t_pass=`grep 'pass ' ./all_tests | wc -l | sed -e 's| ||g'` |
272 |
fi |
273 |
rm -f ./all_tests |
274 |
# echo "${dir##*/} : $t_pass out of $t_tot" |
275 |
|
276 |
tokens=`echo $i | sed -e 's|_| |g'` |
277 |
echo "" > ./ms_tmp |
278 |
for tok in $tokens ; do |
279 |
echo $tok >> ./ms_tmp |
280 |
done |
281 |
DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,3)=="200")'` |
282 |
rm -f ./ms_tmp |
283 |
|
284 |
echo "$OPTFILE$kind $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> ./mlist |
285 |
|
286 |
done |
287 |
|
288 |
# helpful for debugging |
289 |
# cat ./mlist |
290 |
|
291 |
# Do we have any data? If so, create the latest pointer. |
292 |
num=`wc -l ./mlist | awk '{print $1}'` |
293 |
if test $num -gt 0 ; then |
294 |
|
295 |
# swap colors |
296 |
ctmp=$color |
297 |
color=$ncolor |
298 |
ncolor=$ctmp |
299 |
|
300 |
keys=`cat ./mlist | cut -d " " -f 1 | sort | uniq` |
301 |
|
302 |
for key in $keys ; do |
303 |
tline=`grep "^$key " ./mlist | head -1` |
304 |
ratio=`echo $tline | cut -d " " -f 6` |
305 |
ldir=`echo $tline | cut -d " " -f 5` |
306 |
kind=`echo $tline | cut -d " " -f 4` |
307 |
optf=`echo $tline | cut -d " " -f 3` |
308 |
DAY=`echo $tline | cut -d " " -f 2` |
309 |
URL="results/$PERIOD/$ldir" |
310 |
cat <<EOF >>$LATEST |
311 |
<tr bgcolor="$color"> |
312 |
<td height="0"> $mname </td> |
313 |
<td> $optf </td> |
314 |
<td> $kind </td> |
315 |
<td> <a href="$res_url$URL">$DAY</a> </td> |
316 |
<td> <a href="$res_url$URL/summary.txt"> summary.txt </a> </td> |
317 |
<td> $ratio </td> |
318 |
</tr> |
319 |
EOF |
320 |
done |
321 |
fi |
322 |
|
323 |
done |
324 |
|
325 |
cat >> $LATEST << EOF |
326 |
<tr bgcolor="#00cccc"> |
327 |
<td height="0" colspan="6" align="center" >This table generated on: $the_date</td> |
328 |
</tr> |
329 |
|
330 |
</table> |
331 |
|
332 |
<p>Examples of the scripts used for these testing runs can be obtained from: <a |
333 |
href="http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/tools/example_scripts/"> |
334 |
MITgcm/tools/example_scripts</a>.</p> |
335 |
|
336 |
|
337 |
</body> |
338 |
</html> |
339 |
|
340 |
EOF |
341 |
|
342 |
rm -f ./dir_all ./mlist |
343 |
|
344 |
CURR_PER=`date +%Y`"_"`date +%m` |
345 |
if test "x$PERIOD" = "x$CURR_PER" ; then |
346 |
cp $LATEST ./testing.xml |
347 |
( |
348 |
cd $OUTDIR |
349 |
rm -f latest.html |
350 |
ln -s $LATEST latest.html |
351 |
) |
352 |
fi |