/[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.77 by jmc, Fri Apr 5 21:15:06 2013 UTC revision 1.89 by jmc, Tue May 30 04:39:17 2023 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 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 138  for mname in $MACHINES ; do Line 149  for mname in $MACHINES ; do
149          ADJOINT=0          ADJOINT=0
150          TANGLIN=0          TANGLIN=0
151          OPENAD=0          OPENAD=0
152            TAPENAD=0
153          RESTART=0          RESTART=0
154            Special=0
155          EXTRA=          EXTRA=
156          FAST=0          FAST=0
157          DVLP=0          DVLP=0
# Line 146  for mname in $MACHINES ; do Line 159  for mname in $MACHINES ; do
159          MTH=0          MTH=0
160          UR4=0          UR4=0
161          if test -r $dir/summary.txt ; then          if test -r $dir/summary.txt ; then
162                TAPENAD=`grep -c ' Tapenade$' $dir/summary.txt`
163              ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt`              ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt`
             if test "x$ADJOINT" = x1 ; then  
               OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`  
             fi  
164              TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt`              TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt`
165              if test "x$TANGLIN" = x1 ; then              if test "x$ADJOINT" = x1 ; then
166                OPENAD=`grep -c '^TangLin .* OpenAD' $dir/summary.txt`                  OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`
167              fi              fi
168              RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`              RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
169                #- special label for "darwin" tests
170                Special=`echo $i | grep -c '\-darwin[0-9]'`
171                if test $Special != 0 ; then
172                    Special=`echo $i | sed -e "s/.*$mname/$mname/" -e "s/_/ /g" -e "s/-/ /g"`
173                    Special=`echo $Special | awk '{print $2}' | sed 's/darwin//'`
174                fi
175              comm=`grep '^run: .*testreport.* ' $dir/summary.txt`              comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
176              EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`              EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`
177              if test "x$EXTRA" = x ; then              if test "x$EXTRA" = x ; then
# Line 163  for mname in $MACHINES ; do Line 180  for mname in $MACHINES ; do
180              if test "x$EXTRA" = x ; then EXTRA=0 ; else              if test "x$EXTRA" = x ; then EXTRA=0 ; else
181                  #echo -n "EXTRA=$EXTRA"                  #echo -n "EXTRA=$EXTRA"
182                  nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`                  nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`
183                  nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`                  nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`
184                  nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`                  nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`
185                  EXTRA=1                  EXTRA=9
186                  if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi                  if [ $nn1 -ge 2 ] ; then EXTRA=1 ; fi
187                  if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi                  if [ $nn2 -ge 2 ] ; then EXTRA=2 ; fi
188                  #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"                  #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"
189              fi              fi
190              FAST=`echo "$comm" | grep -c " -*-fast\>"`              FAST=`echo "$comm" | grep -c " -*-fast\>"`
# Line 184  for mname in $MACHINES ; do Line 201  for mname in $MACHINES ; do
201              if test "x$UR4" = x0 ; then              if test "x$UR4" = x0 ; then
202                  UR4=`echo "$comm" | grep -c " -*-ur4\>"`                  UR4=`echo "$comm" | grep -c " -*-ur4\>"`
203              fi              fi
204          fi          else EXTRA=0 ; fi
205          if test "x$ADJOINT" = x1 ; then          if test "x$ADJOINT" = x1 ; then
206              kind="adjoint-taf" ; order=0              kind="adjoint-taf" ; order=0
207            if test "x$OPENAD" = x1 ; then            if test "x$TAPENAD" = x1 ; then
208              kind="adjoint-oad" ; order=2              kind="adjoint-Tap" ; order=2
209            fi            elif test "x$OPENAD" = x1 ; then
210                kind="adjoint-oad" ; order=4
211              fi
212          elif test "x$TANGLIN" = x1 ; then          elif test "x$TANGLIN" = x1 ; then
213              kind="tanglin-taf" ; order=1              kind="tanglin-taf" ; order=1
214            if test "x$OPENAD" = x1 ; then            if test "x$TAPENAD" = x1 ; then
215              kind="tanglin-oad" ; order=3              kind="tanglin-Tap" ; order=3
216            fi            fi
217          elif test "x$RESTART" = x0 ; then          elif test "x$RESTART" = x0 ; then
218              kind="forward" ; order=4              kind="forward" ; order=6
219          else          else
220              kind="restart" ; order=5              kind="restart" ; order=7
221          fi          fi
         order=`expr $order + 10 \* $EXTRA`  
         order=`printf '%3.3i' $order`  
222          if test "x$UR4" = x1 ; then          if test "x$UR4" = x1 ; then
223              OPTFILE="${OPTFILE}.use_r4"              OPTFILE="${OPTFILE}.use_r4"
224          fi          fi
225          if test "x$MPI" = x1 ; then          if test "x$MPI" = x1 ; then
226              yy=`echo $OPTFILE | grep -c '+mpi'`              yy=`echo $OPTFILE | grep -c '+mpi'`
227              if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi              if test $yy = 0 ; then yy=`echo $OPTFILE | grep -c '+impi'` ; fi
228                if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi"
229                                  else order=`expr $order + 200` ; fi
230          fi          fi
231          if test "x$MTH" = x1 ; then          if test "x$MTH" = x1 ; then
232              yy=`echo $OPTFILE | grep -c '+mth$'`              yy=`echo $OPTFILE | grep -c '+mth$'`
# Line 219  for mname in $MACHINES ; do Line 238  for mname in $MACHINES ; do
238          if test "x$DVLP" = x1 ; then          if test "x$DVLP" = x1 ; then
239              OPTFILE="${OPTFILE}.dvlp"              OPTFILE="${OPTFILE}.dvlp"
240          fi          fi
241            if [ $Special -eq 0 ] ; then
242                order=`expr $order + 10 \* $EXTRA`
243            else
244                order=`expr $order + 10 \* $Special`
245            fi
246            order=`printf '%3.3i' $order`
247    
248          t_pass="--"          t_pass="--"
249          t_tot="--"          t_tot="--"
# Line 238  for mname in $MACHINES ; do Line 263  for mname in $MACHINES ; do
263          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")'`
264          rm -f ./ms_tmp          rm -f ./ms_tmp
265    
266          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
267    
268      done      done
269    
270      # helpful for debugging      # helpful for debugging
271      # cat ./mlist      # cat $TMP.mlist
272    
273      #  Do we have any data?  If so, create the latest pointer.      #  Do we have any data?  If so, create the latest pointer.
274      num=`wc -l ./mlist | awk '{print $1}'`      num=`wc -l $TMP.mlist | awk '{print $1}'`
275      if test $num -gt 0 ; then      if test $num -gt 0 ; then
276    
277          # swap colors          # swap colors
# Line 254  for mname in $MACHINES ; do Line 279  for mname in $MACHINES ; do
279          color=$ncolor          color=$ncolor
280          ncolor=$ctmp          ncolor=$ctmp
281    
282          keys=`cat ./mlist | cut -d " " -f 1 | sort | uniq`          keys=`cat $TMP.mlist | cut -d " " -f 1 | sort | uniq`
283    
284          for key in $keys ; do          for key in $keys ; do
285              tline=`grep "^$key " ./mlist | head -1`              tline=`grep "^$key " $TMP.mlist | head -1`
286              ratio=`echo $tline | cut -d " " -f 6`              ratio=`echo $tline | cut -d " " -f 6`
287              ldir=`echo $tline | cut -d " " -f 5`              ldir=`echo $tline | cut -d " " -f 5`
288              kind=`echo $tline | cut -d " " -f 4`              kind=`echo $tline | cut -d " " -f 4`
# Line 292  cat >> $OUTFILE << EOF Line 317  cat >> $OUTFILE << EOF
317      </table>      </table>
318    
319  <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
320  href="http://mitgcm.org/viewvc/MITgcm/MITgcm/tools/example_scripts/">  href="http://mitgcm.org/viewvc/MITgcm/MITgcm_contrib/test_scripts/">
321  MITgcm/tools/example_scripts</a>.</p>  MITgcm_contrib/test_scripts</a>.</p>
   
322    
323    </body>    </body>
324  </html>  </html>
325    
326  EOF  EOF
327    
328  rm -f ./dir_all ./mlist  rm -f $TMP.dir_all $TMP.mlist
329    
330  #- put the file in place  #- put the file in place
331  chgrp gcmpack $OUTFILE  chgrp gcmpack $OUTFILE

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.89

  ViewVC Help
Powered by ViewVC 1.1.22