1 |
edhill |
1.1 |
#! /usr/bin/env bash |
2 |
|
|
|
3 |
edhill |
1.4 |
# $Header: /u/u3/gcmpack/mitgcm.org/front_content/make_summary,v 1.3 2003/12/07 00:23:45 edhill 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 |
|
|
# 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="/u/u0/httpd/html/testing/results/$PERIOD" |
58 |
|
|
OUTDIR="/u/u0/httpd/html/testing/summary" |
59 |
|
|
OUTFILE=$OUTDIR"/summary_"$PERIOD".html" |
60 |
|
|
|
61 |
|
|
|
62 |
|
|
# Create the summary file for $PERIOD |
63 |
|
|
echo -n "Creating the summary file for the period \"$PERIOD\" ... " |
64 |
|
|
cat > $OUTFILE << EOF |
65 |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
66 |
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
67 |
|
|
|
68 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
69 |
|
|
<head> |
70 |
|
|
<title>MITgcm testing summary</title> |
71 |
|
|
<meta name="author" content="Ed Hill" /> |
72 |
|
|
<base href="http://mitgcm.org/testing/summary/" /> |
73 |
|
|
</head> |
74 |
|
|
<body> |
75 |
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%"> |
76 |
|
|
|
77 |
|
|
EOF |
78 |
|
|
|
79 |
|
|
# all_files=`find $INDIR -name summary.txt` |
80 |
|
|
all_files=`( cd $INDIR ; find . -name summary.txt )` |
81 |
|
|
|
82 |
|
|
for f in $all_files ; do |
83 |
|
|
|
84 |
|
|
file=$INDIR"/"${f/.\//} |
85 |
|
|
grep "^fresults" $file > /dev/null 2>&1 |
86 |
|
|
RETVAL=$? |
87 |
|
|
if test "x$RETVAL" != x0 ; then |
88 |
|
|
continue |
89 |
|
|
fi |
90 |
|
|
|
91 |
|
|
url=`echo $file | sed -e 's|/u/edhill/www|http://mitgcm.org/~edhill|'` |
92 |
|
|
url=`echo $url | sed -e 's|summary.txt||'` |
93 |
|
|
MACH= |
94 |
|
|
fresults= |
95 |
|
|
color="#eeeeee" |
96 |
|
|
|
97 |
|
|
source $file |
98 |
|
|
echo $fresults | grep FAIL > /dev/null 2>&1 |
99 |
|
|
if test "x$?" = x0 ; then |
100 |
|
|
color="#ff99ff" |
101 |
|
|
fi |
102 |
|
|
echo $fresults | grep pass > /dev/null 2>&1 |
103 |
|
|
if test "x$?" = x0 ; then |
104 |
|
|
color="#99ffff" |
105 |
|
|
fi |
106 |
|
|
|
107 |
|
|
gm_state=`echo $file | sed -e 's/summary.txt/genmake_state/g'` |
108 |
|
|
if test -r $gm_state ; then |
109 |
|
|
grep '^OPTFILE=' $gm_state > ./tmp_state |
110 |
|
|
source ./tmp_state |
111 |
|
|
else |
112 |
|
|
optfile="unknown" |
113 |
|
|
fi |
114 |
|
|
optfile=`echo $OPTFILE | awk -F '/' '{print $NF}'` |
115 |
|
|
|
116 |
|
|
echo "<tr bgcolor=\"$color\">" >> $OUTFILE |
117 |
|
|
echo "<td height=\"0\">$MACH</td>" >> $OUTFILE |
118 |
|
|
echo "<td><a href=\"$url\">$DATE</a></td>" >> $OUTFILE |
119 |
|
|
for i in $fresults ; do |
120 |
|
|
if test "x$i" = xN ; then |
121 |
|
|
echo -n "<td bgcolor=\"#ff6666\">$i</td>" >> $OUTFILE |
122 |
|
|
else |
123 |
|
|
echo -n "<td>$i</td>" >> $OUTFILE |
124 |
|
|
fi |
125 |
|
|
done |
126 |
|
|
echo "<td>$optfile</td>" >> $OUTFILE |
127 |
|
|
echo "</tr>" >> $OUTFILE |
128 |
|
|
|
129 |
|
|
done |
130 |
|
|
|
131 |
|
|
cat >> $OUTFILE << EOF |
132 |
|
|
|
133 |
|
|
</table> |
134 |
|
|
</body> |
135 |
|
|
</html> |
136 |
|
|
|
137 |
|
|
EOF |
138 |
|
|
|
139 |
|
|
chmod a+r $OUTFILE |
140 |
|
|
echo "done" |
141 |
|
|
|
142 |
|
|
|
143 |
|
|
# Create the "latest" links |
144 |
|
|
echo "Creating the \"latest\" file for each machine: " |
145 |
|
|
LATEST=$OUTDIR"/latest_"$PERIOD".html" |
146 |
|
|
cat > $LATEST << EOF |
147 |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
148 |
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
149 |
|
|
|
150 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
151 |
|
|
<head> |
152 |
|
|
<title>MITgcm testing summary</title> |
153 |
|
|
<meta name="author" content="Ed Hill" /> |
154 |
|
|
|
155 |
|
|
<!-- <base href="http://mitgcm.org/testing/summary/" /> --> |
156 |
|
|
|
157 |
|
|
<!-- Hinting for menu generation --> |
158 |
|
|
<meta name="add_name_0" content="Source Code" /> |
159 |
|
|
<meta name="add_name_1" content="Testing" /> |
160 |
|
|
<meta name="add_name_2" content="" /> |
161 |
|
|
<meta name="add_title" content="Testing" /> |
162 |
|
|
<!-- Hinting for menu generation --> |
163 |
|
|
|
164 |
|
|
</head> |
165 |
|
|
<body> |
166 |
edhill |
1.3 |
<p>The MITgcm model is tested |
167 |
edhill |
1.2 |
(compiled and run) in an automated fashion on a varirety of |
168 |
|
|
different machines. The following is a summary of the MITgcm |
169 |
edhill |
1.3 |
verification suite for the time period: <b>$PERIOD</b>.</p> |
170 |
edhill |
1.2 |
|
171 |
|
|
<p>The machine naming scheme is:<br /></p> |
172 |
|
|
<table align="center" cellpadding="0" border="0"> |
173 |
edhill |
1.4 |
<tr bgcolor="#00cccc"> <td><b>Machine Type</b></td> <td><b>Nickname</b></td> |
174 |
edhill |
1.1 |
<td><b>Notes</b></td> </tr> |
175 |
|
|
|
176 |
edhill |
1.2 |
<tr bgcolor="#bbffdd"> <td>Intel P4</td> <td>"faulks"</td> |
177 |
|
|
<td>Red Hat 7.3 (the "original" testing machine)</td> </tr> |
178 |
|
|
<tr bgcolor="#bbddff"> <td>Intel P4</td> <td>"shelley"</td> |
179 |
|
|
<td>Red Hat 9</td> </tr> |
180 |
|
|
|
181 |
|
|
<tr bgcolor="#bbffdd"> <td> Intel P3/P4 Beowulf </td> <td>"myrinet"</td> |
182 |
|
|
<td><a href="http://mitgcm.org/projects/MITGCM_CLUSTER/">MITgcm cluster |
183 |
|
|
facility </a></td> </tr> |
184 |
edhill |
1.1 |
<tr bgcolor="#bbddff"> <td>Alpha cluster</td> <td>"halem"</td> |
185 |
|
|
<td><a href="http://webserv.gsfc.nasa.gov/SCB/NCCS/systems/high-end-computing.html"> |
186 |
|
|
NASA NCCS Halem</a></td> </tr> |
187 |
|
|
|
188 |
|
|
<tr bgcolor="#bbffdd"> <td> SGI Origin 2000 </td> <td>"hopper"</td> |
189 |
|
|
<td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O2K/o2k.html"> |
190 |
|
|
NAS SGI Origin 2000 </a></td> </tr> |
191 |
|
|
<tr bgcolor="#bbddff"> <td> SGI Origin 3000 </td> <td>"lomax"</td> |
192 |
|
|
<td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O3K/o3k.html"> |
193 |
|
|
NAS SGI Origin 3000 </a></td> </tr> |
194 |
|
|
|
195 |
|
|
<tr bgcolor="#bbffdd"> <td> SGI Altix </td> <td>"orion"</td> |
196 |
|
|
<td><a href="http://sc.jpl.nasa.gov/">JPL Supercomputing and |
197 |
|
|
Visualization Facility</a></td> </tr> |
198 |
|
|
<tr bgcolor="#bbddff"> <td> IBM POWER3 SP </td> <td>"bf"</td> |
199 |
|
|
<td><a href="http://www.scd.ucar.edu/computers/blackforest/">NCAR Blackforest |
200 |
|
|
</a></td> </tr> |
201 |
|
|
|
202 |
|
|
<tr bgcolor="#bbffdd"> <td> IBM POWER4 SP </td> <td>"bs"</td> |
203 |
|
|
<td><a href="http://www.scd.ucar.edu/computers/bluesky/">NCAR Bluesky |
204 |
|
|
</a></td> </tr> |
205 |
edhill |
1.4 |
<tr bgcolor="#bbddff"> <td> AMD Opteron </td> <td>"eaps"</td> |
206 |
|
|
<td>SuSE Linux 9.0 (x86-64)</td> </tr> |
207 |
edhill |
1.1 |
|
208 |
|
|
<!-- |
209 |
|
|
<tr bgcolor="#bbddff"> <td> </td> <td>""</td> |
210 |
|
|
<td></td> </tr> |
211 |
|
|
--> |
212 |
|
|
|
213 |
|
|
</table> |
214 |
edhill |
1.2 |
|
215 |
|
|
<p><br /> |
216 |
edhill |
1.3 |
The complete output for the verification runs can be found in |
217 |
edhill |
1.2 |
<a href="http://mitgcm.org/testing/summary/">the summary pages</a>. |
218 |
|
|
The latest reports are:</p> |
219 |
edhill |
1.1 |
<table align="center" cellpadding="0" cellspacing="0" border="0" width="95%"> |
220 |
|
|
<tr bgcolor="#00cccc"> |
221 |
edhill |
1.4 |
<td height="0"> <b>Nickname</b> </td> |
222 |
edhill |
1.1 |
<td> <b>OPTFILE Name</b> </td> |
223 |
edhill |
1.4 |
<td> <b>Type</b> </td> |
224 |
|
|
<td> <b>Date (yyyymmdd)</b> </td> |
225 |
|
|
<td> <b>Summary</b> </td> |
226 |
edhill |
1.1 |
</tr> |
227 |
|
|
|
228 |
|
|
EOF |
229 |
|
|
|
230 |
|
|
color="#bbffdd" |
231 |
|
|
res_url="http://mitgcm.org/testing/" |
232 |
|
|
|
233 |
edhill |
1.3 |
MACHINES="faulks shelley myrinet eaps halem hopper lomax orion bf bs" |
234 |
edhill |
1.1 |
|
235 |
|
|
( cd $INDIR ; ls -1 ) > ./dir_all |
236 |
|
|
|
237 |
|
|
for mname in $MACHINES ; do |
238 |
|
|
|
239 |
|
|
echo " $mname" |
240 |
|
|
if test "x$color" = x#bbffdd ; then |
241 |
|
|
color="#bbddff" |
242 |
|
|
else |
243 |
|
|
color="#bbffdd" |
244 |
|
|
fi |
245 |
|
|
|
246 |
|
|
dir_list=`grep $mname ./dir_all` |
247 |
|
|
echo -n "" > ./mlist |
248 |
|
|
|
249 |
|
|
for i in $dir_list ; do |
250 |
|
|
|
251 |
|
|
dir=$INDIR"/"$i |
252 |
|
|
OPTFILE= |
253 |
|
|
if test -r $dir/summary.txt ; then |
254 |
|
|
comm=`grep 'OPTFILE=' $dir/summary.txt` |
255 |
|
|
eval $comm |
256 |
|
|
OPTFILE=${OPTFILE##*/} |
257 |
|
|
fi |
258 |
|
|
if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then |
259 |
edhill |
1.3 |
comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null` |
260 |
edhill |
1.1 |
eval $comm |
261 |
|
|
OPTFILE=${OPTFILE##*/} |
262 |
|
|
fi |
263 |
|
|
if test "x$OPTFILE" = x ; then |
264 |
edhill |
1.3 |
comm=`grep '^# OPTFILE=' $dir/*/Makefile 2>/dev/null | head -1` |
265 |
|
|
comm=${comm##*#} |
266 |
edhill |
1.1 |
eval $comm |
267 |
|
|
OPTFILE=${OPTFILE##*/} |
268 |
|
|
fi |
269 |
|
|
if test "x$OPTFILE" = x ; then |
270 |
|
|
OPTFILE="not_explicitly_specified" |
271 |
|
|
fi |
272 |
edhill |
1.4 |
|
273 |
|
|
ADJOINT= |
274 |
|
|
if test -r $dir/summary.txt ; then |
275 |
|
|
comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null` |
276 |
|
|
eval $comm |
277 |
|
|
fi |
278 |
|
|
if test "x$ADJOINT" = x ; then |
279 |
|
|
kind="forward" |
280 |
|
|
else |
281 |
|
|
test "x$ADJOINT" = xtrue && kind="adjoint" |
282 |
|
|
fi |
283 |
|
|
|
284 |
edhill |
1.1 |
tokens=`echo $i | sed -e 's|_| |g'` |
285 |
|
|
echo "" > ./ms_tmp |
286 |
|
|
for tok in $tokens ; do |
287 |
|
|
echo $tok >> ./ms_tmp |
288 |
|
|
done |
289 |
|
|
DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,3)=="200")'` |
290 |
|
|
rm -f ./ms_tmp |
291 |
edhill |
1.4 |
|
292 |
|
|
echo "$OPTFILE$kind $DAY $OPTFILE $kind $i" >> ./mlist |
293 |
edhill |
1.1 |
|
294 |
|
|
done |
295 |
|
|
|
296 |
|
|
# helpful for debugging |
297 |
|
|
# cat ./mlist |
298 |
|
|
|
299 |
|
|
# Do we have any data? If so, create the latest pointer. |
300 |
|
|
num=`wc -l ./mlist | awk '{print $1}'` |
301 |
|
|
if test $num -gt 0 ; then |
302 |
edhill |
1.4 |
keys=`cat ./mlist | cut -d " " -f 1 | sort | uniq` |
303 |
edhill |
1.1 |
|
304 |
edhill |
1.4 |
for key in $keys ; do |
305 |
|
|
tline=`grep "^$key " ./mlist | sort -r | head -1` |
306 |
|
|
ldir=`echo $tline | cut -d " " -f 5` |
307 |
|
|
kind=`echo $tline | cut -d " " -f 4` |
308 |
|
|
optf=`echo $tline | cut -d " " -f 3` |
309 |
|
|
DAY=`echo $tline | cut -d " " -f 2` |
310 |
edhill |
1.1 |
URL="results/$PERIOD/$ldir" |
311 |
|
|
cat <<EOF >>$LATEST |
312 |
|
|
<tr bgcolor="$color"> |
313 |
edhill |
1.4 |
<td height="0"> $mname </td> |
314 |
edhill |
1.1 |
<td> $optf </td> |
315 |
edhill |
1.4 |
<td> $kind </td> |
316 |
|
|
<td> <a href="$res_url$URL">$DAY</a> </td> |
317 |
|
|
<td> <a href="$res_url$URL/summary.txt"> summary.txt </a> </td> |
318 |
edhill |
1.1 |
</tr> |
319 |
|
|
EOF |
320 |
|
|
done |
321 |
|
|
fi |
322 |
|
|
|
323 |
|
|
done |
324 |
|
|
|
325 |
|
|
cat >> $LATEST << EOF |
326 |
|
|
|
327 |
|
|
</table> |
328 |
|
|
</body> |
329 |
|
|
</html> |
330 |
|
|
|
331 |
|
|
EOF |
332 |
|
|
|
333 |
|
|
rm -f ./dir_all ./mlist |
334 |
|
|
|
335 |
|
|
CURR_PER=`date +%Y`"_"`date +%m` |
336 |
|
|
if test "x$PERIOD" = "x$CURR_PER" ; then |
337 |
edhill |
1.2 |
cp $LATEST ./testing.xml |
338 |
edhill |
1.1 |
( |
339 |
|
|
cd $OUTDIR |
340 |
|
|
rm -f latest.html |
341 |
|
|
ln -s $LATEST latest.html |
342 |
|
|
) |
343 |
|
|
fi |