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

Diff of /mitgcm.org/front_content/make_summary

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

revision 1.1 by edhill, Sat Dec 6 20:06:58 2003 UTC revision 1.78 by jmc, Thu Aug 22 21:32:54 2013 UTC
# Line 10  usage() Line 10  usage()
10  {  {
11      echo      echo
12      echo "Usage:  $0 [OPTIONS]"      echo "Usage:  $0 [OPTIONS]"
13      echo      echo
14      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
15      echo "  (-help|-h)           print usage"      echo "  (-help|-h)           print usage"
16      echo "  (-date |-d )PERIOD   run for PERIOD=\"YYYY_MM\""      echo "  (-date |-d )PERIOD   run for PERIOD=\"YYYY_MM\""
17      echo "                         [def=\"$PERIOD\"]"      echo "                         [def=\"$PERIOD\"]"
18      echo      echo
19      exit 1      exit 1
20  }  }
21    
22    export LC_ALL="en_US.UTF-8"
23    CURR_PER=`date +%Y`"_"`date +%m`
24  # defaults  # defaults
25  PERIOD=`date +%Y`"_"`date +%m`  PERIOD=$CURR_PER
26    
27  #  Parse options  #  Parse options
28  ac_prev=  ac_prev=
29  for ac_option ; do  for ac_option ; do
30            
31      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
32      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
33          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
34          ac_prev=          ac_prev=
35          continue          continue
36      fi      fi
37        
38      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
39        
40      case $ac_option in      case $ac_option in
41            
42          -help | --help | -h | --h)          -help | --help | -h | --h)
43              usage ;;              usage ;;
44            
45          -date | --date | -d | --d)          -date | --date | -d | --d)
46              ac_prev=PERIOD ;;              ac_prev=PERIOD ;;
47          --date=* | -date=*)          --date=* | -date=*)
48              PERIOD=$ac_optarg ;;              PERIOD=$ac_optarg ;;
49            
50          *)          *)
51              echo "Error: don't understand argument \"$ac_option\""              echo "Error: don't understand argument \"$ac_option\""
52              usage              usage
53              ;;              ;;
54            
55       esac       esac
56        
57  done  done
58    
59    #INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD"
60    #OUTDIR="/home/jmc/mitgcm/test_web/summary"
61  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
62  OUTDIR="/u/u0/httpd/html/testing/summary"  OUTDIR="/u/u0/httpd/html/testing/summary"
 OUTFILE=$OUTDIR"/summary_"$PERIOD".html"  
   
   
 #  Create the summary file for $PERIOD  
 echo -n "Creating the summary file for the period \"$PERIOD\" ...  "  
 cat > $OUTFILE << EOF  
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
   
 <html xmlns="http://www.w3.org/1999/xhtml">  
   <head>  
     <title>MITgcm testing summary</title>  
     <meta name="author" content="Ed Hill" />  
     <base href="http://mitgcm.org/testing/summary/" />  
   </head>  
   <body>  
     <table cellpadding="0" cellspacing="0" border="0" width="100%">  
   
 EOF  
   
 # all_files=`find $INDIR -name summary.txt`  
 all_files=`( cd $INDIR ; find . -name summary.txt )`  
   
 for f in $all_files ; do  
63    
64      file=$INDIR"/"${f/.\//}  OUTFILE=$OUTDIR"/output_"$PERIOD".html"
65      grep "^fresults" $file > /dev/null 2>&1  res_url="http://mitgcm.org/testing/"
     RETVAL=$?  
     if test "x$RETVAL" != x0 ; then  
         continue  
     fi  
   
     url=`echo $file | sed -e 's|/u/edhill/www|http://mitgcm.org/~edhill|'`  
     url=`echo $url | sed -e 's|summary.txt||'`  
     MACH=  
     fresults=  
     color="#eeeeee"  
   
     source $file  
     echo $fresults | grep FAIL > /dev/null 2>&1  
     if test "x$?" = x0 ; then  
         color="#ff99ff"  
     fi  
     echo $fresults | grep pass > /dev/null 2>&1  
     if test "x$?" = x0 ; then  
         color="#99ffff"  
     fi  
   
     gm_state=`echo $file | sed -e 's/summary.txt/genmake_state/g'`  
     if test -r $gm_state ; then  
         grep '^OPTFILE=' $gm_state > ./tmp_state  
         source ./tmp_state  
     else  
         optfile="unknown"  
     fi  
     optfile=`echo $OPTFILE | awk -F '/' '{print $NF}'`  
   
     echo "<tr bgcolor=\"$color\">" >> $OUTFILE  
     echo "<td height=\"0\">$MACH</td>" >> $OUTFILE  
     echo "<td><a href=\"$url\">$DATE</a></td>" >> $OUTFILE  
     for i in $fresults ; do  
         if test "x$i" = xN ; then  
             echo -n "<td bgcolor=\"#ff6666\">$i</td>" >> $OUTFILE  
         else  
             echo -n "<td>$i</td>" >> $OUTFILE  
         fi  
     done  
     echo "<td>$optfile</td>" >> $OUTFILE  
     echo "</tr>" >> $OUTFILE  
   
 done  
   
 cat >> $OUTFILE << EOF  
   
     </table>  
   </body>  
 </html>  
   
 EOF  
   
 chmod a+r $OUTFILE  
 echo "done"  
66    
67    #TMP=./mksum_$$
68    #- try to put temporary files in system-local /tmp dir
69    TMP=/tmp/mksum_$$
70    touch $TMP ; retVal=$?
71    if [ $retVal -eq 0 ] ; then
72      if test ! -r $TMP ; then TMP=./mksum_$$ ; fi
73    else
74      TMP=./mksum_$$
75    fi
76    rm -f $TMP
77    # echo "temp files: $TMP"
78    
79  #  Create the "latest" links  #  Create the links in $OUTFILE :
80  echo "Creating the \"latest\" file for each machine: "  echo "Creating the \"latest\" file for each machine: "
81  LATEST=$OUTDIR"/latest_"$PERIOD".html"  the_date=`date`
 cat > $LATEST << EOF  
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
   
 <html xmlns="http://www.w3.org/1999/xhtml">  
   <head>  
     <title>MITgcm testing summary</title>  
     <meta name="author" content="Ed Hill" />  
   
     <!-- <base href="http://mitgcm.org/testing/summary/" /> -->  
   
     <!-- Hinting for menu generation -->  
     <meta name="add_name_0" content="Source Code" />  
     <meta name="add_name_1" content="Testing" />  
     <meta name="add_name_2" content="" />  
     <meta name="add_title" content="Testing" />  
     <!-- Hinting for menu generation -->  
   
   </head>  
   <body>  
     <p>The following are the most recent MITgcm testing runs for the  
       time period <b>$PERIOD</b>.<br /><br />  
       The machine naming scheme is:<br /></p>  
     <table align="center" border="0">  
       <tr bgcolor="#00cccc"> <td><b>Machine</b></td> <td><b>"Nickname"</b></td>  
         <td><b>Notes</b></td> </tr>  
   
       <tr bgcolor="#bbffdd"> <td>faulks.lcs.mit.edu</td> <td>"faulks"</td>  
         <td>Red Hat 7.3 on an Intel P4 (the "original" testing machine)</td> </tr>  
       <tr bgcolor="#bbddff"> <td>shelley.lcs.mit.edu</td> <td>"shelley"</td>  
         <td>Red Hat 9 on an Intel P4</td> </tr>  
   
       <tr bgcolor="#bbffdd"> <td>cg01.lcs.mit.edu cluster</td> <td>"myrinet"</td>  
         <td><a href="http://mitgcm.org/projects/MITGCM_CLUSTER/">MITgcm cluster facility  
         </a></td> </tr>  
       <tr bgcolor="#bbddff"> <td>Alpha cluster</td> <td>"halem"</td>  
         <td><a href="http://webserv.gsfc.nasa.gov/SCB/NCCS/systems/high-end-computing.html">  
         NASA NCCS Halem</a></td> </tr>  
   
       <tr bgcolor="#bbffdd"> <td> SGI Origin 2000 </td> <td>"hopper"</td>  
         <td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O2K/o2k.html">  
         NAS SGI Origin 2000 </a></td> </tr>  
       <tr bgcolor="#bbddff"> <td> SGI Origin 3000 </td> <td>"lomax"</td>  
         <td><a href="http://www.nas.nasa.gov/User/Systemsdocs/O3K/o3k.html">  
         NAS SGI Origin 3000 </a></td> </tr>  
   
       <tr bgcolor="#bbffdd"> <td> SGI Altix </td> <td>"orion"</td>  
         <td><a href="http://sc.jpl.nasa.gov/">JPL Supercomputing and  
         Visualization Facility</a></td> </tr>  
       <tr bgcolor="#bbddff"> <td> IBM POWER3 SP </td> <td>"bf"</td>  
         <td><a href="http://www.scd.ucar.edu/computers/blackforest/">NCAR Blackforest  
         </a></td> </tr>  
   
       <tr bgcolor="#bbffdd"> <td> IBM POWER4 SP </td> <td>"bs"</td>  
         <td><a href="http://www.scd.ucar.edu/computers/bluesky/">NCAR Bluesky  
         </a></td> </tr>  
   
       <!--  
       <tr bgcolor="#bbddff"> <td>  </td> <td>""</td>  
         <td></td> </tr>  
       -->  
82    
83      </table>  sed "s/_PERIOD/$PERIOD/" summary_head > $OUTFILE
84      <br />  cat <<EOF >>$OUTFILE
85      <table align="center" cellpadding="0" cellspacing="0" border="0" width="95%">      <table align="center" cellpadding="0" cellspacing="0" border="0" width="95%">
86  <tr bgcolor="#00cccc">  <tr bgcolor="#00cccc">
87    <td height="0"> <b>"Nickname"</b> </td>    <td height="0"> <b>Nickname</b> </td>
88    <td> <b>OPTFILE Name</b> </td>    <td> <b>OPTFILE Name</b> </td>
89    <td> <b>Date (YYYYMMDD)</b> </td>    <td> <b>Type</b> </td>
90      <td> <b>Date</b> </td>
91      <td> <b>Summary</b> </td>
92      <td> <b>Ratio</b> </td>
93  </tr>  </tr>
94    
95  EOF  EOF
96    
97  color="#bbffdd"  color="#bbffdd"
98  res_url="http://mitgcm.org/testing/"  ncolor="#bbddff"
99    
100  MACHINES="faulks shelley myrinet halem hopper lomax orion bf bs"  MACHINES="aces- acesgrid baudelaire dickens danton beagle"
101    MACHINES="$MACHINES pleiades iblade sx8 uv100 solasrv stomp weber"
102    
103  ( cd $INDIR ; ls -1 ) > ./dir_all  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > $TMP.dir_all
104    
105    MALL=`cat $TMP.dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`
106    for madd in $MALL ; do
107        present=0
108        for m in $MACHINES ; do
109            echo $madd | grep $m > /dev/null 2>&1
110            RETVAL=$?
111            test $RETVAL = 0  &&  present=1
112            continue
113        done
114        test $present = 0  &&  MACHINES="$MACHINES $madd"
115    done
116    #MACHINES="baudelaire"
117    
118  for mname in $MACHINES ; do  for mname in $MACHINES ; do
119    
120      echo "  $mname"      echo "  $mname"
     if test "x$color" = x#bbffdd ; then  
         color="#bbddff"  
     else  
         color="#bbffdd"  
     fi  
121    
122      dir_list=`grep $mname ./dir_all`      dir_list=`grep $mname $TMP.dir_all`
123      echo -n "" > ./mlist      echo -n "" > $TMP.mlist
124    
125      for i in $dir_list ; do      for i in $dir_list ; do
126    
# Line 245  for mname in $MACHINES ; do Line 132  for mname in $MACHINES ; do
132              OPTFILE=${OPTFILE##*/}              OPTFILE=${OPTFILE##*/}
133          fi          fi
134          if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then          if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then
135              comm=`grep 'OPTFILE=' $dir/genmake_state`              comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`
136              eval $comm              eval $comm
137              OPTFILE=${OPTFILE##*/}              OPTFILE=${OPTFILE##*/}
138          fi          fi
139          if test "x$OPTFILE" = x ; then          if test "x$OPTFILE" = x ; then
140              comm=`grep '^# OPTFILE=' $dir/*/Makefile 2>/dev/null | head -1 | sed -e 's|^# ||'`              comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`
141                comm=${comm##*#}
142              eval $comm              eval $comm
143              OPTFILE=${OPTFILE##*/}              OPTFILE=${OPTFILE##*/}
144          fi          fi
145          if test "x$OPTFILE" = x ; then          if test "x$OPTFILE" = x ; then
146              OPTFILE="not_explicitly_specified"              OPTFILE="not_explicitly_specified"
147          fi          fi
148    
149            # EXTRA = non-standard list of experiment
150            ADJOINT=0
151            TANGLIN=0
152            OPENAD=0
153            RESTART=0
154            EXTRA=
155            FAST=0
156            DVLP=0
157            MPI=0
158            MTH=0
159            UR4=0
160            if test -r $dir/summary.txt ; then
161                ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt`
162                if test "x$ADJOINT" = x1 ; then
163                  OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`
164                fi
165                TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt`
166                if test "x$TANGLIN" = x1 ; then
167                  OPENAD=`grep -c '^TangLin .* OpenAD' $dir/summary.txt`
168                fi
169                RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
170                comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
171                EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`
172                if test "x$EXTRA" = x ; then
173                    EXTRA=`echo "$comm" | grep " -*-t\>" | sed -e "s/^.*-*-t\>//" -e "s/ -.*$//"`
174                fi
175                if test "x$EXTRA" = x ; then EXTRA=0 ; else
176                    #echo -n "EXTRA=$EXTRA"
177                    nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`
178                    nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`
179                    nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`
180                    EXTRA=1
181                    if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi
182                    if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi
183                    #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"
184                fi
185                FAST=`echo "$comm" | grep -c " -*-fast\>"`
186                if test "x$FAST" = x0 ; then
187                    FAST=`echo "$comm" | grep -c " '*-noieee'*"`
188                fi
189                DVLP=`echo "$comm" | grep -c " -*-devel\>"`
190                MPI=`echo "$comm" | grep -c " -*-mpi\>"`
191                if test "x$MPI" = x0 ; then
192                    MPI=`echo "$comm" | grep -c " -*-MPI\>"`
193                fi
194                MTH=`echo "$comm" | grep -c " -*-mth\>"`
195                UR4=`echo "$comm" | grep -c " -*-use_r4\>"`
196                if test "x$UR4" = x0 ; then
197                    UR4=`echo "$comm" | grep -c " -*-ur4\>"`
198                fi
199            fi
200            if test "x$ADJOINT" = x1 ; then
201                kind="adjoint-taf" ; order=0
202              if test "x$OPENAD" = x1 ; then
203                kind="adjoint-oad" ; order=2
204              fi
205            elif test "x$TANGLIN" = x1 ; then
206                kind="tanglin-taf" ; order=1
207              if test "x$OPENAD" = x1 ; then
208                kind="tanglin-oad" ; order=3
209              fi
210            elif test "x$RESTART" = x0 ; then
211                kind="forward" ; order=4
212            else
213                kind="restart" ; order=5
214            fi
215            order=`expr $order + 10 \* $EXTRA`
216            order=`printf '%3.3i' $order`
217            if test "x$UR4" = x1 ; then
218                OPTFILE="${OPTFILE}.use_r4"
219            fi
220            if test "x$MPI" = x1 ; then
221                yy=`echo $OPTFILE | grep -c '+mpi'`
222                if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
223            fi
224            if test "x$MTH" = x1 ; then
225                yy=`echo $OPTFILE | grep -c '+mth$'`
226                if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
227            fi
228            if test "x$FAST" = x1 ; then
229                OPTFILE="${OPTFILE}.fast"
230            fi
231            if test "x$DVLP" = x1 ; then
232                OPTFILE="${OPTFILE}.dvlp"
233            fi
234    
235            t_pass="--"
236            t_tot="--"
237            if test -r $dir/summary.txt ; then
238                grep '^[YN] [YN] [YN] [YN]' $dir/summary.txt > ./all_tests 2>/dev/null
239                t_tot=`cat ./all_tests | wc -l | sed -e 's| ||g'`
240                t_pass=`grep '^Y Y Y Y' ./all_tests | grep 'pass ' | wc -l | sed -e 's| ||g'`
241            fi
242            rm -f ./all_tests
243            # echo "${dir##*/} : $t_pass out of $t_tot"
244    
245          tokens=`echo $i | sed -e 's|_| |g'`          tokens=`echo $i | sed -e 's|_| |g'`
246          echo "" > ./ms_tmp          echo "" > ./ms_tmp
247          for tok in $tokens ; do          for tok in $tokens ; do
248              echo $tok >> ./ms_tmp              echo $tok >> ./ms_tmp
249          done          done
250          DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,3)=="200")'`          DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,2)=="20")'`
251          rm -f ./ms_tmp          rm -f ./ms_tmp
252          echo "$OPTFILE $DAY $i" >> ./mlist  
253            echo "$OPTFILE$order $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> $TMP.mlist
254    
255      done      done
256    
257      # helpful for debugging      # helpful for debugging
258      # cat ./mlist      # cat $TMP.mlist
259    
260      #  Do we have any data?  If so, create the latest pointer.      #  Do we have any data?  If so, create the latest pointer.
261      num=`wc -l ./mlist | awk '{print $1}'`      num=`wc -l $TMP.mlist | awk '{print $1}'`
262      if test $num -gt 0 ; then      if test $num -gt 0 ; then
         optfiles=`cat ./mlist | cut -d " " -f 1 | sort | uniq`  
263    
264          for optf in $optfiles ; do          # swap colors
265              ldir=`grep "^$optf " ./mlist | sort -r | head -1 | cut -d " " -f 3`          ctmp=$color
266            color=$ncolor
267            ncolor=$ctmp
268    
269            keys=`cat $TMP.mlist | cut -d " " -f 1 | sort | uniq`
270    
271            for key in $keys ; do
272                tline=`grep "^$key " $TMP.mlist | head -1`
273                ratio=`echo $tline | cut -d " " -f 6`
274                ldir=`echo $tline | cut -d " " -f 5`
275                kind=`echo $tline | cut -d " " -f 4`
276                optf=`echo $tline | cut -d " " -f 3`
277                DAY=`echo $tline | cut -d " " -f 2`
278              URL="results/$PERIOD/$ldir"              URL="results/$PERIOD/$ldir"
279              cat <<EOF >>$LATEST              #-- machine name to print:
280                sname=`echo $mname | sed 's/-$//'`
281                alt=`echo $key | sed "s/$optf//"`
282               #if   [ $alt -ge 30 ] ; then sname="${sname}.darwin"
283               #elif [ $alt -ge 20 ] ; then sname="${sname}.monod" ; fi
284                cat <<EOF >>$OUTFILE
285  <tr bgcolor="$color">  <tr bgcolor="$color">
286    <td height="0"><a href="$res_url$URL"> $mname </a></td>    <td height="0"> $sname </td>
287    <td> $optf </td>    <td> $optf </td>
288    <td> $DAY </td>    <td> $kind </td>
289      <td> <a href="$res_url$URL">$DAY</a> </td>
290      <td> <a href="$res_url$URL/summary.txt"> summary.txt </a> </td>
291      <td> $ratio </td>
292  </tr>  </tr>
293  EOF  EOF
294          done          done
# Line 291  EOF Line 296  EOF
296    
297  done  done
298    
299  cat >> $LATEST << EOF  cat >> $OUTFILE << EOF
300    <tr bgcolor="#00cccc">
301      <td height="0" colspan="6" align="center" >This table generated on: $the_date</td>
302    </tr>
303    
304      </table>      </table>
305    
306    <p>Examples of the scripts used for these testing runs can be obtained from: <a
307    href="http://mitgcm.org/viewvc/MITgcm/MITgcm/tools/example_scripts/">
308    MITgcm/tools/example_scripts</a>.</p>
309    
310    
311    </body>    </body>
312  </html>  </html>
313    
314  EOF  EOF
315    
316  rm -f ./dir_all ./mlist  rm -f $TMP.dir_all $TMP.mlist
317    
318    #- put the file in place
319    chgrp gcmpack $OUTFILE
320    chmod 664 $OUTFILE
321    LATEST=$OUTDIR"/latest_"$PERIOD".html"
322    mv -f $OUTFILE $LATEST
323    
 CURR_PER=`date +%Y`"_"`date +%m`  
324  if test "x$PERIOD" = "x$CURR_PER" ; then  if test "x$PERIOD" = "x$CURR_PER" ; then
325      cp $LATEST ./results.xml      cp $LATEST ./testing.xml
326      (      (
327          cd $OUTDIR          cd $OUTDIR
328          rm -f latest.html          rm -f latest.html

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.78

  ViewVC Help
Powered by ViewVC 1.1.22