/[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.9 by jmc, Sun May 2 18:42:06 2021 UTC revision 1.17 by jmc, Mon Oct 2 13:02:27 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'      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    #- expect higher precision if test is run on reference platform+compiler:
50    MC=13
51    
52    echo "-- run: \""`basename $0` $*"\" on:" `date` >> $logFile
53    gcmDIR="MITgcm"
54    if test -e $gcmDIR/.git/config ; then : ; else
55      echo " No current clone ==> get a fresh clone" >> $logFile
56      #rm -f git_Hash prevHash
57      if test -d $gcmDIR ; then /bin/rm -rf $gcmDIR ; fi
58      git clone https://github.com/$git_repo/${git_code}.git $gcmDIR
59      ( cd $gcmDIR ; git rev-parse HEAD > ../git_Hash )
60    fi
61    
62    #-------------------------------------------------------------------------------
63    #-- check particular set of tests:
64    if test $1 = tap ; then
65    #- Only run this pair of test if MITgcm code got updated:
66      if test -f git_Hash -a -f prevHash ; then
67       #ls -l prevHash  >> $logFile
68        diff -q git_Hash prevHash > /dev/null 2>&1
69        retv=$?
70        if test $retv = 0 ; then
71          echo " No update in repos since previous test ==> skip '$1' set of tests"  >> $logFile
72          exit 0
73        else
74          echo " Will run '$1' set of tests since repos has been updated" >> $logFile
75          echo -n ' prevHash: ' >> $logFile
76          cat prevHash >> $logFile
77          echo -n ' git_Hash: ' >> $logFile
78          cat git_Hash >> $logFile
79        fi
80      else
81        echo " No file 'prevHash' --> will run '$1' set of tests" >> $logFile
82      fi
83    elif test $1 = gfort ; then
84      #- to force to skip "tap" test while "gfort" is running:
85      if test -f prevHash ; then
86        cp -p prevHash git_Hash
87      else
88        cp -p git_Hash prevHash
89      fi
90    fi
91    
92    echo "run: \""`basename $0` $*"\" on:" `date`
93    echo " tst_list='$tst_list'"
94    
95    #- to get ~/bin in the patch (for staf) when run on cron:
96    if [ -d ~/bin ]; then
97      echo 'add ~/bin to $PATH'
98      export PATH=$PATH:~/bin
99    #- and for Tapenade:
100      echo $tst_list | grep '\<tap' > /dev/null 2>&1 ; retv=$?
101      if test $retv = 0 ; then
102        source ~jmc/bin/set_tapenade.sh
103      fi
104    fi
105    
106  #-- for now, cannot mix ifort/gfortran tests:  #- for now, cannot mix ifort/gfortran tests:
107  gfort=1  gfort=1
108  for tt in $tst_list  for tt in $tst_list
109  do  do
110    echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?    echo $tt | grep '^tap' > /dev/null 2>&1 ; retv=$?
111      if [ $retv -ne 0 ] ; then
112        echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?
113      fi
114    if   [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2    if   [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2
115    elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0    elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0
116    else echo 'cannot mix ifort/gfortran' ; exit    else echo 'cannot mix ifort/gfortran' ; exit
# Line 66  if [ $gfort -eq 2 ] ; then Line 127  if [ $gfort -eq 2 ] ; then
127     source ~jmc/bin/openmpi.sh     source ~jmc/bin/openmpi.sh
128  fi  fi
129    
130  #--------------------------------------------------------------------  #-------------------------------------------------------------------------------
131    #-- Update & Run individual test:
132  for tt in $tst_list  for tt in $tst_list
133  do  do
134    
135    #- Clean and Update testing clone: ---------------------------------------------
136    gcmDIR="MITgcm_$tt"    gcmDIR="MITgcm_$tt"
137    echo "=========================================================================="    echo "=========================================================================="
138  # set -x  # set -x
139    rm -f tr_clean_$tt.log    rm -f tr_clean_$tt.log
140    echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?    echo $tt | grep '^.ad' > /dev/null 2>&1 ; taf=$?
141    echo " testing tt= $tt , fwd= $fwd"    echo $tt | grep '^tap' > /dev/null 2>&1 ; tap=$?
142      if test $tt = g7a ; then taf=0 ; fi
143      echo " testing tt= $tt , taf= $taf , tap= $tap"
144   if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then   if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
145   #- cleaning previous testreport run and updating the code:   #- cleaning previous testreport run and updating the code:
146    if [ $fwd -eq 0 ] ; then    if [ $taf -eq 0 -o $tap -eq 0 ] ; then
147       if test $tt = 'tapTL' ; then clOpt='-tlm' ; else clOpt='-adm' ; fi
148       if [ $tap -eq 0 ] ; then clOpt="-tap $clOpt" ; fi
149     set -x     set -x
150    #- cleanup previous test:    #- cleanup previous test:
151     ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )     ( cd $gcmDIR/verification ; ./testreport $clOpt -clean > ../../tr_clean_$tt.log 2>&1 )
152     set +x     set +x
153    else    else
154     set -x     set -x
# Line 148  do Line 215  do
215    pwd    pwd
216    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
217    
218    #- Run test in corresponding clone: --------------------------------------------
219  case $tt in  case $tt in
220  'iadm' )  'iadm' )
221    
# Line 234  case $tt in Line 302  case $tt in
302    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
303  ;;  ;;
304    
305    'tapAD')
306    
307      ./testreport -tap -adm -of ../tools/build_options/linux_amd64_gfortran \
308       -match $MC $sendCmd >> ../../tr_run_$tt.log 2>&1
309    
310      sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
311    ;;
312    
313    'tapTL')
314    
315      ./testreport -tap -tlm -of ../tools/build_options/linux_amd64_gfortran \
316       -match $MC $sendCmd >> ../../tr_run_$tt.log 2>&1
317    
318      sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
319    ;;
320    
321    'g7a')
322    
323      ./testreport -adm -of ../tools/build_options/linux_amd64_g77 \
324       -skd 'halfpipe_streamice' \
325       -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
326    
327      sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
328    ;;
329    
330  'gmp2')  'gmp2')
331    
332    export OMP_NUM_THREADS=2    export OMP_NUM_THREADS=2
# Line 305  case $tt in Line 398  case $tt in
398  'g77')  'g77')
399    
400    ./testreport -of ../tools/build_options/linux_amd64_g77 \    ./testreport -of ../tools/build_options/linux_amd64_g77 \
401     -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \     -skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20 halfpipe_streamice internal_wave tutorial_advection_in_gyre' \
402     -nc $sendCmd >> ../../tr_run_$tt.log 2>&1     -nc $sendCmd >> ../../tr_run_$tt.log 2>&1
403    
404    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
# Line 327  esac Line 420  esac
420   fi   fi
421    
422  done  done
423    
424    if test $1 = gfort ; then
425      day=`date +%d`
426      echo " day in the month='${day}'"
427      if test $day = 01 -a -f git_Hash ; then
428        ls -l git_Hash
429        echo -n ' git_Hash: '
430        cat git_Hash
431        echo "Remove file 'git_Hash' to force tomorrow 'tap' testing"
432        rm -f git_Hash
433      fi
434    fi

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.22