/[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.76 by jmc, Sun Feb 24 15:27:58 2013 UTC revision 1.88 by jmc, Sat Dec 3 16:57:13 2022 UTC
# Line 5  Line 5 
5  #  The purpose of this script is to create HTML summaries of the  #  The purpose of this script is to create HTML summaries of the
6  #  directories produced by the "parse_emails" script.  #  directories produced by the "parse_emails" script.
7    
   
8  usage()  usage()
9  {  {
10      echo      echo
# Line 64  OUTDIR="/u/u0/httpd/html/testing/summary Line 63  OUTDIR="/u/u0/httpd/html/testing/summary
63  OUTFILE=$OUTDIR"/output_"$PERIOD".html"  OUTFILE=$OUTDIR"/output_"$PERIOD".html"
64  res_url="http://mitgcm.org/testing/"  res_url="http://mitgcm.org/testing/"
65    
66    #TMP=./mksum_$$
67    #- try to put temporary files in system-local /tmp dir
68    TMP=/tmp/mksum_$$
69    touch $TMP ; retVal=$?
70    if [ $retVal -eq 0 ] ; then
71      if test ! -r $TMP ; then TMP=./mksum_$$ ; fi
72    else
73      TMP=./mksum_$$
74    fi
75    rm -f $TMP
76    # echo "temp files: $TMP"
77    
78  #  Create the links in $OUTFILE :  #  Create the links in $OUTFILE :
79  echo "Creating the \"latest\" file for each machine: "  echo "Creating the \"latest\" file for each machine: "
80  the_date=`date`  the_date=`date`
# Line 85  EOF Line 96  EOF
96  color="#bbffdd"  color="#bbffdd"
97  ncolor="#bbddff"  ncolor="#bbddff"
98    
99  MACHINES="aces- acesgrid baudelaire dickens danton beagle"  MACHINES="villon batsi engaging svante glacier"
100  MACHINES="$MACHINES pleiades iblade sx8 uv100 solasrv stomp weber"  MACHINES="$MACHINES ollie albedo pleiades archer"
101    
102  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > $TMP.dir_all
103    
104  MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`  MALL=`cat $TMP.dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`
105  for madd in $MALL ; do  for madd in $MALL ; do
106      present=0      present=0
107      for m in $MACHINES ; do      for m in $MACHINES ; do
# Line 107  for mname in $MACHINES ; do Line 118  for mname in $MACHINES ; do
118    
119      echo "  $mname"      echo "  $mname"
120    
121      dir_list=`grep $mname ./dir_all`      dir_list=`grep $mname $TMP.dir_all`
122      echo -n "" > ./mlist      echo -n "" > $TMP.mlist
123    
124      for i in $dir_list ; do      for i in $dir_list ; do
125    
# Line 135  for mname in $MACHINES ; do Line 146  for mname in $MACHINES ; do
146          fi          fi
147    
148          # EXTRA = non-standard list of experiment          # EXTRA = non-standard list of experiment
149          ADJOINT=          ADJOINT=0
150          TANGLIN=          TANGLIN=0
151            OPENAD=0
152          RESTART=0          RESTART=0
153            Special=0
154          EXTRA=          EXTRA=
155          FAST=0          FAST=0
156          DVLP=0          DVLP=0
# Line 145  for mname in $MACHINES ; do Line 158  for mname in $MACHINES ; do
158          MTH=0          MTH=0
159          UR4=0          UR4=0
160          if test -r $dir/summary.txt ; then          if test -r $dir/summary.txt ; then
161              comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`              ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt`
162              eval $comm              if test "x$ADJOINT" = x1 ; then
163              comm=`grep 'TANGLIN=true' $dir/summary.txt 2>/dev/null`                OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`
164              eval $comm              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`              RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
170                #- special label for "darwin" tests
171                Special=`echo $i | grep -c '\-darwin[0-9]'`
172                if test $Special != 0 ; then
173                    Special=`echo $i | sed -e "s/.*$mname/$mname/" -e "s/_/ /g" -e "s/-/ /g"`
174                    Special=`echo $Special | awk '{print $2}' | sed 's/darwin//'`
175                fi
176              comm=`grep '^run: .*testreport.* ' $dir/summary.txt`              comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
177              EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`              EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`
178              if test "x$EXTRA" = x ; then              if test "x$EXTRA" = x ; then
# Line 158  for mname in $MACHINES ; do Line 181  for mname in $MACHINES ; do
181              if test "x$EXTRA" = x ; then EXTRA=0 ; else              if test "x$EXTRA" = x ; then EXTRA=0 ; else
182                  #echo -n "EXTRA=$EXTRA"                  #echo -n "EXTRA=$EXTRA"
183                  nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`                  nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`
184                  nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`                  nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`
185                  nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`                  nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`
186                  EXTRA=1                  EXTRA=9
187                  if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi                  if [ $nn1 -ge 2 ] ; then EXTRA=1 ; fi
188                  if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi                  if [ $nn2 -ge 2 ] ; then EXTRA=2 ; fi
189                  #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"                  #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"
190              fi              fi
191              FAST=`echo "$comm" | grep -c " -*-fast\>"`              FAST=`echo "$comm" | grep -c " -*-fast\>"`
# Line 179  for mname in $MACHINES ; do Line 202  for mname in $MACHINES ; do
202              if test "x$UR4" = x0 ; then              if test "x$UR4" = x0 ; then
203                  UR4=`echo "$comm" | grep -c " -*-ur4\>"`                  UR4=`echo "$comm" | grep -c " -*-ur4\>"`
204              fi              fi
205          fi          else EXTRA=0 ; fi
206          if test "x$ADJOINT" = xtrue ; then          if test "x$ADJOINT" = x1 ; then
207              kind="adjoint" ; order=0              kind="adjoint-taf" ; order=0
208          elif test "x$TANGLIN" = xtrue ; then            if test "x$OPENAD" = x1 ; then
209              kind="tanglin" ; order=1              kind="adjoint-oad" ; order=2
210              fi
211            elif test "x$TANGLIN" = x1 ; then
212                kind="tanglin-taf" ; order=1
213              if test "x$OPENAD" = x1 ; then
214                kind="tanglin-oad" ; order=3
215              fi
216          elif test "x$RESTART" = x0 ; then          elif test "x$RESTART" = x0 ; then
217              kind="forward" ; order=2              kind="forward" ; order=4
218          else          else
219              kind="restart" ; order=3              kind="restart" ; order=5
220          fi          fi
         order=`expr $order + 10 \* $EXTRA`  
         order=`printf '%3.3i' $order`  
221          if test "x$UR4" = x1 ; then          if test "x$UR4" = x1 ; then
222              OPTFILE="${OPTFILE}.use_r4"              OPTFILE="${OPTFILE}.use_r4"
223          fi          fi
224          if test "x$MPI" = x1 ; then          if test "x$MPI" = x1 ; then
225              yy=`echo $OPTFILE | grep -c '+mpi'`              yy=`echo $OPTFILE | grep -c '+mpi'`
226              if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi              if test $yy = 0 ; then yy=`echo $OPTFILE | grep -c '+impi'` ; fi
227                if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi"
228                                  else order=`expr $order + 200` ; fi
229          fi          fi
230          if test "x$MTH" = x1 ; then          if test "x$MTH" = x1 ; then
231              yy=`echo $OPTFILE | grep -c '+mth$'`              yy=`echo $OPTFILE | grep -c '+mth$'`
# Line 208  for mname in $MACHINES ; do Line 237  for mname in $MACHINES ; do
237          if test "x$DVLP" = x1 ; then          if test "x$DVLP" = x1 ; then
238              OPTFILE="${OPTFILE}.dvlp"              OPTFILE="${OPTFILE}.dvlp"
239          fi          fi
240            if [ $Special -eq 0 ] ; then
241                order=`expr $order + 10 \* $EXTRA`
242            else
243                order=`expr $order + 10 \* $Special`
244            fi
245            order=`printf '%3.3i' $order`
246    
247          t_pass="--"          t_pass="--"
248          t_tot="--"          t_tot="--"
# Line 227  for mname in $MACHINES ; do Line 262  for mname in $MACHINES ; do
262          DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,2)=="20")'`          DAY=`cat ./ms_tmp | awk '(length($1)==8 && substr($1,0,2)=="20")'`
263          rm -f ./ms_tmp          rm -f ./ms_tmp
264    
265          echo "$OPTFILE$order $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> ./mlist          echo "$OPTFILE$order $DAY $OPTFILE $kind $i $t_pass:$t_tot" >> $TMP.mlist
266    
267      done      done
268    
269      # helpful for debugging      # helpful for debugging
270      # cat ./mlist      # cat $TMP.mlist
271    
272      #  Do we have any data?  If so, create the latest pointer.      #  Do we have any data?  If so, create the latest pointer.
273      num=`wc -l ./mlist | awk '{print $1}'`      num=`wc -l $TMP.mlist | awk '{print $1}'`
274      if test $num -gt 0 ; then      if test $num -gt 0 ; then
275    
276          # swap colors          # swap colors
# Line 243  for mname in $MACHINES ; do Line 278  for mname in $MACHINES ; do
278          color=$ncolor          color=$ncolor
279          ncolor=$ctmp          ncolor=$ctmp
280    
281          keys=`cat ./mlist | cut -d " " -f 1 | sort | uniq`          keys=`cat $TMP.mlist | cut -d " " -f 1 | sort | uniq`
282    
283          for key in $keys ; do          for key in $keys ; do
284              tline=`grep "^$key " ./mlist | head -1`              tline=`grep "^$key " $TMP.mlist | head -1`
285              ratio=`echo $tline | cut -d " " -f 6`              ratio=`echo $tline | cut -d " " -f 6`
286              ldir=`echo $tline | cut -d " " -f 5`              ldir=`echo $tline | cut -d " " -f 5`
287              kind=`echo $tline | cut -d " " -f 4`              kind=`echo $tline | cut -d " " -f 4`
# Line 281  cat >> $OUTFILE << EOF Line 316  cat >> $OUTFILE << EOF
316      </table>      </table>
317    
318  <p>Examples of the scripts used for these testing runs can be obtained from: <a  <p>Examples of the scripts used for these testing runs can be obtained from: <a
319  href="http://mitgcm.org/viewvc/MITgcm/MITgcm/tools/example_scripts/">  href="http://mitgcm.org/viewvc/MITgcm/MITgcm_contrib/test_scripts/">
320  MITgcm/tools/example_scripts</a>.</p>  MITgcm_contrib/test_scripts</a>.</p>
   
321    
322    </body>    </body>
323  </html>  </html>
324    
325  EOF  EOF
326    
327  rm -f ./dir_all ./mlist  rm -f $TMP.dir_all $TMP.mlist
328    
329  #- put the file in place  #- put the file in place
330  chgrp gcmpack $OUTFILE  chgrp gcmpack $OUTFILE

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.88

  ViewVC Help
Powered by ViewVC 1.1.22