/[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.29 by jmc, Tue Aug 9 16:40:29 2011 UTC revision 1.37 by jmc, Thu Mar 7 21:57:45 2013 UTC
# Line 6  Line 6 
6  #  the latest output with the previous one (from the same platform with  #  the latest output with the previous one (from the same platform with
7  #    same optfile)  #    same optfile)
8    
   
9  usage()  usage()
10  {  {
11      echo      echo
# Line 15  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 101  make_resdir_list() Line 102  make_resdir_list()
102              fi              fi
103    
104              ADJOINT=              ADJOINT=
105                TANGLIN=
106              RESTART=0              RESTART=0
107                EXTRA=
108              FAST=0              FAST=0
109              DVLP=0              DVLP=0
110                MPI=0
111              MTH=0              MTH=0
112                UR4=0
113              if test -r $dir/summary.txt ; then              if test -r $dir/summary.txt ; then
114                  comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`                  comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`
115                  eval $comm                  eval $comm
116                    comm=`grep 'TANGLIN=true' $dir/summary.txt 2>/dev/null`
117                    eval $comm
118                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
119                  FAST=`grep -c "^run: .*testreport.* '*-fast'*" $dir/summary.txt`                  comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
120                    EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`
121                    if test "x$EXTRA" = x ; then
122                        EXTRA=`echo "$comm" | grep " -*-t\>" | sed -e "s/^.*-*-t\>//" -e "s/ -.*$//"`
123                    fi
124                    if test "x$EXTRA" = x ; then EXTRA=0 ; else
125                        #echo -n "EXTRA=$EXTRA"
126                        nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`
127                        nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`
128                        nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`
129                        EXTRA=1
130                        if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi
131                        if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi
132                        #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"
133                    fi
134                    FAST=`echo "$comm" | grep -c " -*-fast\>"`
135                  if test "x$FAST" = x0 ; then                  if test "x$FAST" = x0 ; then
136                     FAST=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`                     FAST=`echo "$comm" | grep -c " '*-noieee'*"`
137                    fi
138                    DVLP=`echo "$comm" | grep -c " -*-devel\>"`
139                    MPI=`echo "$comm" | grep -c " -*-mpi\>"`
140                    if test "x$MPI" = x0 ; then
141                       MPI=`echo "$comm" | grep -c " -*-MPI\>"`
142                    fi
143                    MTH=`echo "$comm" | grep -c " -*-mth\>"`
144                    UR4=`echo "$comm" | grep -c " -*-use_r4\>"`
145                    if test "x$UR4" = x0 ; then
146                       UR4=`echo "$comm" | grep -c " -*-ur4\>"`
147                  fi                  fi
                 DVLP=`grep -c "^run: .*testreport.* '*-devel'*" $dir/summary.txt`  
                 MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt`  
148              fi              fi
149              if test "x$RESTART" = x0 ; then              if test "x$ADJOINT" = xtrue ; then
150                  kind="forward"                  kind="adjoint" ; order=0
151                  test "x$ADJOINT" = xtrue  &&  kind="adjoint"              elif test "x$TANGLIN" = xtrue ; then
152                    kind="tanglin" ; order=1
153                elif test "x$RESTART" = x0 ; then
154                    kind="forward" ; order=2
155              else              else
156                  kind="restart"                  kind="restart" ; order=3
157                fi
158                order=`expr $order + 10 \* $EXTRA`
159                order=`printf '%3.3i' $order`
160                if test "x$UR4" = x1 ; then
161                    OPTFILE="${OPTFILE}.use_r4"
162                fi
163                if test "x$MPI" = x1 ; then
164                    yy=`echo $OPTFILE | grep -c '+mpi'`
165                    if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
166              fi              fi
167              if test "x$MTH" = x1 ; then              if test "x$MTH" = x1 ; then
168                  yy=`echo $OPTFILE | grep -c '+mth$'`                  yy=`echo $OPTFILE | grep -c '+mth$'`
# Line 136  make_resdir_list() Line 178  make_resdir_list()
178              ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`              ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
179              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`
180    
181              if [ $day -lt $BEFORE ] ; then              if [ $day -lt $BEFORE ] ; then
182                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist                  echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./plist
183              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then
184                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist                  echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./slist
185              else              else
186                  if test $dBug = 't' ; then                  if test $dBug = 't' ; then
187                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL
# Line 166  make_resdir_list() Line 208  make_resdir_list()
208    
209  #CURR_PER=`date +%Y`"_"`date +%m`  #CURR_PER=`date +%Y`"_"`date +%m`
210  CURR_DAY=`date +%Y%m%d`  CURR_DAY=`date +%Y%m%d`
211    PRC_MAILS='prc_emails_'`date +%m%d`
212  # defaults  # defaults
213  MACHINES='_All_'  MACHINES='_All_'
214  FIRSTDAY=$CURR_DAY  FIRSTDAY=$CURR_DAY
# Line 175  OUTPFIL=`basename $0`'.log' Line 218  OUTPFIL=`basename $0`'.log'
218  NBLDIFF=5  NBLDIFF=5
219  ADDRESS='none'  ADDRESS='none'
220  dBug=f  dBug=f
221    t4update=0
222  sTime=`date`  sTime=`date`
223  #- to get case insensitive "ls" (and order of tested experiments)  #- to get case insensitive "ls" (and order of tested experiments)
224  export LC_ALL="en_US.UTF-8"  export LC_ALL="en_US.UTF-8"
# Line 185  for ac_option ; do Line 229  for ac_option ; do
229    
230      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
231      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
232          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
233          ac_prev=          ac_prev=
234          continue          continue
235      fi      fi
236    
237      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Line 196  for ac_option ; do Line 240  for ac_option ; do
240                    
241          -help | --help | -h | --h) usage ;;          -help | --help | -h | --h) usage ;;
242          -verbose | --verbose | -v | --v) dBug=t ;;          -verbose | --verbose | -v | --v) dBug=t ;;
243            -test4update | --test4update | -t | --t) t4update=1 ;;
244                    
245          -list  | --list  | -l | --l) ac_prev=MACHINES ;;          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
246          -list=* | --list=*) MACHINES=$ac_optarg ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
# Line 254  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9 Line 299  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9
299  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
300  #INDIR="/export/export-7/u/u2/jmc/mitgcm/test_web/results/$PERIOD"  #INDIR="/export/export-7/u/u2/jmc/mitgcm/test_web/results/$PERIOD"
301    
302    #- a short summary of this checking :
303    OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'`
304    OUTPSUM=`basename $0`"$OUTPSUM.txt"
305    
306  if test $OUTPFIL = '-1' ; then  if test $OUTPFIL = '-1' ; then
307    OUTPFIL='TTT.'$$    OUTPFIL='TTT.'$$
308    fi
309    if test $t4update = 1 ; then
310      if test -f $PRC_MAILS -a -f $OUTPSUM -a $FIRSTDAY = $CURR_DAY ; then
311        #- if update-log-file is older than previous output summary, just return
312        if test $PRC_MAILS -ot $OUTPSUM ; then
313          echo ' '$CMDLINE | tee -a $OUTPSUM
314          echo " t4update: skip "`basename $0`" ( $PRC_MAILS older than $OUTPSUM )" | tee -a $OUTPSUM
315          echo "End  time:   "`date` | tee -a $OUTPSUM
316          exit 0
317        else
318          if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi
319          echo " t4update: run "`basename $0`" ( $PRC_MAILS newer than $OUTPSUM )" | tee $OUTPFIL
320        fi
321      else
322          if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi
323          echo " t4update ignored (not current day or $PRC_MAILS or $OUTPSUM missing)" | tee $OUTPFIL
324      fi
325  elif test -e $OUTPFIL ; then  elif test -e $OUTPFIL ; then
326    mv -f $OUTPFIL $OUTPFIL'_bak'    mv -f $OUTPFIL $OUTPFIL'_bak'
327      touch $OUTPFIL
328  fi  fi
329  echo "CMDLINE='$CMDLINE'" > $OUTPFIL  if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi
330    echo ' '$CMDLINE > $OUTPSUM
331    
332    echo "CMDLINE='$CMDLINE'" >> $OUTPFIL
333  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL
334  echo "INDIR='$INDIR'" >> $OUTPFIL  echo "INDIR='$INDIR'" >> $OUTPFIL
335  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL
# Line 282  else Line 352  else
352    exit 3    exit 3
353  fi  fi
354    
 #- 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  
   
355  if test $FIRSTDAY = $LASTDAY ; then  if test $FIRSTDAY = $LASTDAY ; then
356    echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM    echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM
357  else  else
# Line 304  echo "     name     checked   comp    Di Line 368  echo "     name     checked   comp    Di
368  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all
369    
370  if test "x$MACHINES" = "x_All_" ; then  if test "x$MACHINES" = "x_All_" ; then
371    MACHINES="faulks meander aces- acesgrid baudelaire dickens danton beagle harbor"    MACHINES="aces- acesgrid baudelaire dickens danton beagle"
372    MACHINES="$MACHINES pleiades iblade rays solasrv sx8"    MACHINES="$MACHINES pleiades iblade sx8 uv100 solasrv stomp weber"
   MACHINES="$MACHINES trane dodongo dokdo stomp bigred"  
373    
374    MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`    MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`
375    for madd in $MALL ; do    for madd in $MALL ; do

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.37

  ViewVC Help
Powered by ViewVC 1.1.22