/[MITgcm]/mitgcm.org/scripts/check_outp
ViewVC logotype

Diff of /mitgcm.org/scripts/check_outp

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

revision 1.35 by jmc, Sun Feb 24 15:29:05 2013 UTC revision 1.38 by jmc, Fri Apr 5 21:15:52 2013 UTC
# Line 14  usage() Line 14  usage()
14      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
15      echo "  (-h|-help)            print usage"      echo "  (-h|-help)            print usage"
16      echo "  (-v|-verbose)         verbose mode"      echo "  (-v|-verbose)         verbose mode"
17        echo "  (-t|-test4update)     do nothing if previous output newer than"
18        echo "                         emails-processing log-file '$PRC_MAILS'"
19      echo "  (-l |-list )MACHINES  check platforms from this list"      echo "  (-l |-list )MACHINES  check platforms from this list"
20      echo "                         [def=\"$MACHINES\"]"      echo "                         [def=\"$MACHINES\"]"
21      echo "  (-d |-day  )FIRSTDAY  select output from day=\"YYYYMMDD\""      echo "  (-d |-day  )FIRSTDAY  select output from day=\"YYYYMMDD\""
# Line 99  make_resdir_list() Line 101  make_resdir_list()
101                  fi                  fi
102              fi              fi
103    
104              ADJOINT=              ADJOINT=0
105              TANGLIN=              TANGLIN=0
106                OPENAD=0
107              RESTART=0              RESTART=0
108              EXTRA=              EXTRA=
109              FAST=0              FAST=0
# Line 109  make_resdir_list() Line 112  make_resdir_list()
112              MTH=0              MTH=0
113              UR4=0              UR4=0
114              if test -r $dir/summary.txt ; then              if test -r $dir/summary.txt ; then
115                  comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`                  ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt`
116                  eval $comm                  if test "x$ADJOINT" = x1 ; then
117                  comm=`grep 'TANGLIN=true' $dir/summary.txt 2>/dev/null`                    OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`
118                  eval $comm                  fi
119                    TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt`
120                    if test "x$TANGLIN" = x1 ; then
121                      OPENAD=`grep -c '^TangLin .* OpenAD' $dir/summary.txt`
122                    fi
123                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
124                  comm=`grep '^run: .*testreport.* ' $dir/summary.txt`                  comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
125                  EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`                  EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`
# Line 144  make_resdir_list() Line 151  make_resdir_list()
151                     UR4=`echo "$comm" | grep -c " -*-ur4\>"`                     UR4=`echo "$comm" | grep -c " -*-ur4\>"`
152                  fi                  fi
153              fi              fi
154              if test "x$ADJOINT" = xtrue ; then              if test "x$ADJOINT" = x1 ; then
155                  kind="adjoint" ; order=0                  kind="adm-TAF" ; order=0
156              elif test "x$TANGLIN" = xtrue ; then                  if test "x$OPENAD" = x1 ; then kind="adm-OAD" ; order=2 ; fi
157                  kind="tanglin" ; order=1              elif test "x$TANGLIN" = x1 ; then
158                    kind="tlm-TAF" ; order=1
159                    if test "x$OPENAD" = x1 ; then kind="tlm-OAD" ; order=3 ; fi
160              elif test "x$RESTART" = x0 ; then              elif test "x$RESTART" = x0 ; then
161                  kind="forward" ; order=2                  kind="forward" ; order=4
162              else              else
163                  kind="restart" ; order=3                  kind="restart" ; order=5
164              fi              fi
165              order=`expr $order + 10 \* $EXTRA`              order=`expr $order + 10 \* $EXTRA`
166              order=`printf '%3.3i' $order`              order=`printf '%3.3i' $order`
# Line 206  make_resdir_list() Line 215  make_resdir_list()
215    
216  #CURR_PER=`date +%Y`"_"`date +%m`  #CURR_PER=`date +%Y`"_"`date +%m`
217  CURR_DAY=`date +%Y%m%d`  CURR_DAY=`date +%Y%m%d`
218    PRC_MAILS='prc_emails_'`date +%m%d`
219  # defaults  # defaults
220  MACHINES='_All_'  MACHINES='_All_'
221  FIRSTDAY=$CURR_DAY  FIRSTDAY=$CURR_DAY
# Line 215  OUTPFIL=`basename $0`'.log' Line 225  OUTPFIL=`basename $0`'.log'
225  NBLDIFF=5  NBLDIFF=5
226  ADDRESS='none'  ADDRESS='none'
227  dBug=f  dBug=f
228    t4update=0
229  sTime=`date`  sTime=`date`
230  #- to get case insensitive "ls" (and order of tested experiments)  #- to get case insensitive "ls" (and order of tested experiments)
231  export LC_ALL="en_US.UTF-8"  export LC_ALL="en_US.UTF-8"
# Line 236  for ac_option ; do Line 247  for ac_option ; do
247                    
248          -help | --help | -h | --h) usage ;;          -help | --help | -h | --h) usage ;;
249          -verbose | --verbose | -v | --v) dBug=t ;;          -verbose | --verbose | -v | --v) dBug=t ;;
250            -test4update | --test4update | -t | --t) t4update=1 ;;
251                    
252          -list  | --list  | -l | --l) ac_prev=MACHINES ;;          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
253          -list=* | --list=*) MACHINES=$ac_optarg ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
# Line 294  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9 Line 306  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9
306  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
307  #INDIR="/export/export-7/u/u2/jmc/mitgcm/test_web/results/$PERIOD"  #INDIR="/export/export-7/u/u2/jmc/mitgcm/test_web/results/$PERIOD"
308    
309    #- a short summary of this checking :
310    OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'`
311    OUTPSUM=`basename $0`"$OUTPSUM.txt"
312    
313  if test $OUTPFIL = '-1' ; then  if test $OUTPFIL = '-1' ; then
314    OUTPFIL='TTT.'$$    OUTPFIL='TTT.'$$
315    fi
316    if test $t4update = 1 ; then
317      if test -f $PRC_MAILS -a -f $OUTPSUM -a $FIRSTDAY = $CURR_DAY ; then
318        #- if update-log-file is older than previous output summary, just return
319        if test $PRC_MAILS -ot $OUTPSUM ; then
320          echo ' '$CMDLINE | tee -a $OUTPSUM
321          echo " t4update: skip "`basename $0`" ( $PRC_MAILS older than $OUTPSUM )" | tee -a $OUTPSUM
322          echo "End  time:   "`date` | tee -a $OUTPSUM
323          exit 0
324        else
325          if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi
326          echo " t4update: run "`basename $0`" ( $PRC_MAILS newer than $OUTPSUM )" | tee $OUTPFIL
327        fi
328      else
329          if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi
330          echo " t4update ignored (not current day or $PRC_MAILS or $OUTPSUM missing)" | tee $OUTPFIL
331      fi
332  elif test -e $OUTPFIL ; then  elif test -e $OUTPFIL ; then
333    mv -f $OUTPFIL $OUTPFIL'_bak'    mv -f $OUTPFIL $OUTPFIL'_bak'
334      touch $OUTPFIL
335  fi  fi
336  echo "CMDLINE='$CMDLINE'" > $OUTPFIL  if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi
337    echo ' '$CMDLINE > $OUTPSUM
338    
339    echo "CMDLINE='$CMDLINE'" >> $OUTPFIL
340  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL
341  echo "INDIR='$INDIR'" >> $OUTPFIL  echo "INDIR='$INDIR'" >> $OUTPFIL
342  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL
# Line 322  else Line 359  else
359    exit 3    exit 3
360  fi  fi
361    
 #- a short summary of this checking :  
 OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'`  
 OUTPSUM=`basename $0`"$OUTPSUM.txt"  
 if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi  
 echo ' '$CMDLINE > $OUTPSUM  
   
362  if test $FIRSTDAY = $LASTDAY ; then  if test $FIRSTDAY = $LASTDAY ; then
363    echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM    echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM
364  else  else

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.22