/[MITgcm]/MITgcm_contrib/test_scripts/other/test_local
ViewVC logotype

Diff of /MITgcm_contrib/test_scripts/other/test_local

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

revision 1.10 by jmc, Tue Sep 21 14:28:33 2021 UTC revision 1.15 by jmc, Wed Jun 14 04:18:20 2023 UTC
# Line 3  Line 3 
3  # $Header$  # $Header$
4  # $Name$  # $Name$
5    
6    #-------------------------------------------------------------------------------
7    #-- process argument list:
8  if test $# = 0 ; then  if test $# = 0 ; then
9    echo 'need 1 argument'    echo 'need 1 argument'
10    exit    exit
# Line 13  else Line 15  else
15      dd1=`date +%d -d "1 day"`      dd1=`date +%d -d "1 day"`
16  #   if test $dd1 != '01' ; then echo 'not last day of month'; exit ; fi  #   if test $dd1 != '01' ; then echo 'not last day of month'; exit ; fi
17    elif test $1 = gfort ; then    elif test $1 = gfort ; then
18      tst_list='gadm gads gad4 gmp4 gmp2 gfo gfo4 g77 g7a'      tst_list='gadm gads gad4 gmp4 gmp2 gfo gfo4'
19    #   tst_list="$tst_list g77 g7a"
20      elif test $1 = tap ; then
21        tst_list='tapAD tapTL'
22    elif test $1 = gfor8 ; then    elif test $1 = gfor8 ; then
23  #   tst_list='gadm gads gmp2 gmpi gfo g77'  #   tst_list='gadm gads gmp2 gmpi gfo g77'
24      tst_list='gadm gads gmp2 gfo'      tst_list='gadm gads gmp2 gfo'
# Line 23  else Line 28  else
28      tst_list=$*      tst_list=$*
29    fi    fi
30  fi  fi
   echo "run: \""`basename $0` $*"\" on:" `date`  
   echo " tst_list='$tst_list'"  
31    
32  #- to get ~/bin in the patch (for staf) when run on cron:  #-------------------------------------------------------------------------------
33  if [ -d ~/bin ]; then  #-- general setting + MITgcm ref clone update:
34    echo 'add ~/bin to $PATH'  #
   export PATH=$PATH:~/bin  
 fi  
35  #- to get case insensitive "ls" (and order of tested experiments)  #- to get case insensitive "ls" (and order of tested experiments)
36  #export LC_ALL="en_US.UTF-8"  #export LC_ALL="en_US.UTF-8"
37  #- Turn off stack limit for FIZHI & AD-tests  #- Turn off stack limit for FIZHI & AD-tests
# Line 42  ulimit -s unlimited Line 43  ulimit -s unlimited
43   #git_repo='altMITgcm'; #git_code='MITgcm66h'   #git_repo='altMITgcm'; #git_code='MITgcm66h'
44  #- other settings:  #- other settings:
45  tmpFil="/tmp/"`basename $0`".$$"  tmpFil="/tmp/"`basename $0`".$$"
46    logFile='check_update.log'
47  sendCmd='-a jm_c@mitgcm.org'  sendCmd='-a jm_c@mitgcm.org'
48  sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test'  sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test'
49    
50  #-- for now, cannot mix ifort/gfortran tests:  echo "-- run: \""`basename $0` $*"\" on:" `date` >> $logFile
51    gcmDIR="MITgcm"
52    if test -e $gcmDIR/.git/config ; then : ; else
53      echo " No current clone ==> get a fresh clone" >> $logFile
54      #rm -f git_Hash prevHash
55      if test -d $gcmDIR ; then /bin/rm -rf $gcmDIR ; fi
56      git clone https://github.com/$git_repo/${git_code}.git $gcmDIR
57      ( cd $gcmDIR ; git rev-parse HEAD > ../git_Hash )
58    fi
59    
60    #-------------------------------------------------------------------------------
61    #-- check particular set of tests:
62    if test $1 = tap ; then
63    #- Only run this pair of test if MITgcm code got updated:
64      if test -f git_Hash -a -f prevHash ; then
65       #ls -l prevHash  >> $logFile
66        diff -q git_Hash prevHash > /dev/null 2>&1
67        retv=$?
68        if test $retv = 0 ; then
69          echo " No update in repos since previous test ==> skip '$1' set of tests"  >> $logFile
70          exit 0
71        else
72          echo " Will run '$1' set of tests since repos has been updated" >> $logFile
73          echo -n ' prevHash: ' >> $logFile
74          cat prevHash >> $logFile
75          echo -n ' git_Hash: ' >> $logFile
76          cat git_Hash >> $logFile
77        fi
78      else
79        echo " No file 'prevHash' --> will run '$1' set of tests" >> $logFile
80      fi
81    elif test $1 = gfort ; then
82      #- to force to skip "tap" test while "gfort" is running:
83      if test -f prevHash ; then
84        cp -p prevHash git_Hash
85      else
86        cp -p git_Hash prevHash
87      fi
88    fi
89    
90    echo "run: \""`basename $0` $*"\" on:" `date`
91    echo " tst_list='$tst_list'"
92    
93    #- to get ~/bin in the patch (for staf) when run on cron:
94    if [ -d ~/bin ]; then
95      echo 'add ~/bin to $PATH'
96      export PATH=$PATH:~/bin
97    #- and for Tapenade:
98      echo $tst_list | grep '\<tap' > /dev/null 2>&1 ; retv=$?
99      if test $retv = 0 ; then
100        source ~jmc/bin/set_tapenade.sh
101      fi
102    fi
103    
104    #- for now, cannot mix ifort/gfortran tests:
105  gfort=1  gfort=1
106  for tt in $tst_list  for tt in $tst_list
107  do  do
108    echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?    echo $tt | grep '^tap' > /dev/null 2>&1 ; retv=$?
109      if [ $retv -ne 0 ] ; then
110        echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?
111      fi
112    if   [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2    if   [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2
113    elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0    elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0
114    else echo 'cannot mix ifort/gfortran' ; exit    else echo 'cannot mix ifort/gfortran' ; exit
# Line 66  if [ $gfort -eq 2 ] ; then Line 125  if [ $gfort -eq 2 ] ; then
125     source ~jmc/bin/openmpi.sh     source ~jmc/bin/openmpi.sh
126  fi  fi
127    
128  #--------------------------------------------------------------------  #-------------------------------------------------------------------------------
129    #-- Update & Run individual test:
130  for tt in $tst_list  for tt in $tst_list
131  do  do
132    
133    #- Clean and Update testing clone: ---------------------------------------------
134    gcmDIR="MITgcm_$tt"    gcmDIR="MITgcm_$tt"
135    echo "=========================================================================="    echo "=========================================================================="
136  # set -x  # set -x
137    rm -f tr_clean_$tt.log    rm -f tr_clean_$tt.log
138    echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?    echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?
139    if test $tt = g7a ; then fwd=0 ; fi    echo $tt | grep '^tap' > /dev/null 2>&1 ; tap=$?
140      if test $tt = g7a -o $tap = 0 ; then fwd=0 ; clOpt='-adm' ; fi
141    echo " testing tt= $tt , fwd= $fwd"    echo " testing tt= $tt , fwd= $fwd"
142   if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then   if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
143   #- cleaning previous testreport run and updating the code:   #- cleaning previous testreport run and updating the code:
144    if [ $fwd -eq 0 ] ; then    if [ $fwd -eq 0 ] ; then
145       if test $tt = 'tapAD' ; then clOpt='-tap -adm' ; fi
146       if test $tt = 'tapTL' ; then clOpt='-tap -tlm' ; fi
147     set -x     set -x
148    #- cleanup previous test:    #- cleanup previous test:
149     ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )     ( cd $gcmDIR/verification ; ./testreport $clOpt -clean > ../../tr_clean_$tt.log 2>&1 )
150     set +x     set +x
151    else    else
152     set -x     set -x
# Line 149  do Line 213  do
213    pwd    pwd
214    test -e tr_out.txt && mv -f tr_out.txt tr_out.sav    test -e tr_out.txt && mv -f tr_out.txt tr_out.sav
215    
216    #- Run test in corresponding clone: --------------------------------------------
217  case $tt in  case $tt in
218  'iadm' )  'iadm' )
219    
# Line 235  case $tt in Line 300  case $tt in
300    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
301  ;;  ;;
302    
303    'tapAD')
304    
305      ./testreport -tap -adm -of ../tools/build_options/linux_amd64_gfortran \
306       $sendCmd >> ../../tr_run_$tt.log 2>&1
307    
308      sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
309    ;;
310    
311    'tapTL')
312    
313      ./testreport -tap -tlm -of ../tools/build_options/linux_amd64_gfortran \
314       $sendCmd >> ../../tr_run_$tt.log 2>&1
315    
316      sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
317    ;;
318    
319  'g7a')  'g7a')
320    
321    ./testreport -adm -of ../tools/build_options/linux_amd64_g77 \    ./testreport -adm -of ../tools/build_options/linux_amd64_g77 \
322       -skd 'halfpipe_streamice' \
323     -nc $sendCmd >> ../../tr_run_$tt.log 2>&1     -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
324    
325    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
# Line 314  case $tt in Line 396  case $tt in
396  'g77')  'g77')
397    
398    ./testreport -of ../tools/build_options/linux_amd64_g77 \    ./testreport -of ../tools/build_options/linux_amd64_g77 \
399     -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \     -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20 halfpipe_streamice internal_wave tutorial_advection_in_gyre' \
400     -nc $sendCmd >> ../../tr_run_$tt.log 2>&1     -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
401    
402    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
# Line 336  esac Line 418  esac
418   fi   fi
419    
420  done  done
421    
422    if test $1 = gfort ; then
423      day=`date +%d`
424      echo " day in the month='${day}'"
425      if test $day = 01 -a -f git_Hash ; then
426        ls -l git_Hash
427        echo -n ' git_Hash: '
428        cat git_Hash
429        echo "Remove file 'git_Hash' to force tomorrow 'tap' testing"
430        rm -f git_Hash
431      fi
432    fi

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22