/[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.12 by jmc, Thu Feb 16 21:29:01 2023 UTC revision 1.13 by jmc, Wed May 31 13:51:39 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 15  else Line 17  else
17    elif test $1 = gfort ; then    elif test $1 = gfort ; then
18      tst_list='gadm gads gad4 gmp4 gmp2 gfo gfo4'      tst_list='gadm gads gad4 gmp4 gmp2 gfo gfo4'
19  #   tst_list="$tst_list g77 g7a"  #   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 24  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 46  tmpFil="/tmp/"`basename $0`".$$" Line 46  tmpFil="/tmp/"`basename $0`".$$"
46  sendCmd='-a jm_c@mitgcm.org'  sendCmd='-a jm_c@mitgcm.org'
47  sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test'  sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test'
48    
49  #-- for now, cannot mix ifort/gfortran tests:  gcmDIR="MITgcm"
50    logFile='check_update.log'
51    echo "-- run: \""`basename $0` $*"\" on:" `date` >> $logFile
52    if test -e $gcmDIR/.git/config -a -f git_Hash ; then
53      mv git_Hash prevHash
54      ( cd $gcmDIR ; git pull > /dev/null )
55      ( cd $gcmDIR ; git rev-parse HEAD > ../git_Hash )
56    else
57      echo " No current clone or missing file "git_Hash" ==> get a fresh clone" >> $logFile
58      rm -f prevHash
59      if test -d $gcmDIR ; then /bin/rm -rf $gcmDIR ; fi
60      git clone https://github.com/$git_repo/${git_code}.git $gcmDIR
61      ( cd $gcmDIR ; git rev-parse HEAD > ../git_Hash )
62    fi
63    
64    #-------------------------------------------------------------------------------
65    #-- check particular set of tests:
66    if test $1 = tap ; then
67    #- Only run this pair of test if MITgcm code got updated:
68      if test -f prevHash ; then
69       #ls -l prevHash  >> $logFile
70        diff -q git_Hash prevHash > /dev/null 2>&1
71        retv=$?
72        if test $retv = 0 ; then
73          echo " No update in repos since previous test ==> skip '$1' set of tests"  >> $logFile
74          exit 0
75        else
76          echo " Will run '$1' set of tests since repos has been updated" >> $logFile
77          echo -n ' prevHash: ' >> $logFile
78          cat prevHash >> $logFile
79          echo -n ' git_Hash: ' >> $logFile
80          cat git_Hash >> $logFile
81        fi
82      else
83        echo " No file 'prevHash' --> will run '$1' set of tests" >> $logFile
84      fi
85    fi
86    
87    echo "run: \""`basename $0` $*"\" on:" `date`
88    echo " tst_list='$tst_list'"
89    
90    #- to get ~/bin in the patch (for staf) when run on cron:
91    if [ -d ~/bin ]; then
92      echo 'add ~/bin to $PATH'
93      export PATH=$PATH:~/bin
94    #- and for Tapenade:
95      echo $tst_list | grep '\<tap' > /dev/null 2>&1 ; retv=$?
96      if test $retv = 0 ; then
97        source ~jmc/bin/set_tapenade.sh
98      fi
99    fi
100    
101    #- for now, cannot mix ifort/gfortran tests:
102  gfort=1  gfort=1
103  for tt in $tst_list  for tt in $tst_list
104  do  do
105    echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?    echo $tt | grep '^tap' > /dev/null 2>&1 ; retv=$?
106      if [ $retv -ne 0 ] ; then
107        echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$?
108      fi
109    if   [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2    if   [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2
110    elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0    elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0
111    else echo 'cannot mix ifort/gfortran' ; exit    else echo 'cannot mix ifort/gfortran' ; exit
# Line 67  if [ $gfort -eq 2 ] ; then Line 122  if [ $gfort -eq 2 ] ; then
122     source ~jmc/bin/openmpi.sh     source ~jmc/bin/openmpi.sh
123  fi  fi
124    
125  #--------------------------------------------------------------------  #-------------------------------------------------------------------------------
126    #-- Update & Run individual test:
127  for tt in $tst_list  for tt in $tst_list
128  do  do
129    
130    #- Clean and Update testing clone: ---------------------------------------------
131    gcmDIR="MITgcm_$tt"    gcmDIR="MITgcm_$tt"
132    echo "=========================================================================="    echo "=========================================================================="
133  # set -x  # set -x
134    rm -f tr_clean_$tt.log    rm -f tr_clean_$tt.log
135    echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?    echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$?
136    if test $tt = g7a ; then fwd=0 ; fi    echo $tt | grep '^tap' > /dev/null 2>&1 ; tap=$?
137      if test $tt = g7a -o $tap = 0 ; then fwd=0 ; clOpt='-adm' ; fi
138    echo " testing tt= $tt , fwd= $fwd"    echo " testing tt= $tt , fwd= $fwd"
139   if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then   if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then
140   #- cleaning previous testreport run and updating the code:   #- cleaning previous testreport run and updating the code:
141    if [ $fwd -eq 0 ] ; then    if [ $fwd -eq 0 ] ; then
142       if test $tt = 'tapAD' ; then clOpt='-tap -adm' ; fi
143       if test $tt = 'tapTL' ; then clOpt='-tap -tlm' ; fi
144     set -x     set -x
145    #- cleanup previous test:    #- cleanup previous test:
146     ( cd $gcmDIR/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 )     ( cd $gcmDIR/verification ; ./testreport $clOpt -clean > ../../tr_clean_$tt.log 2>&1 )
147     set +x     set +x
148    else    else
149     set -x     set -x
# Line 150  do Line 210  do
210    pwd    pwd
211    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
212    
213    #- Run test in corresponding clone: --------------------------------------------
214  case $tt in  case $tt in
215  'iadm' )  'iadm' )
216    
# Line 235  case $tt in Line 296  case $tt in
296    
297    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log    sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
298  ;;  ;;
299    
300    'tapAD')
301    
302      ./testreport -tap -adm -of ../tools/build_options/linux_amd64_gfortran \
303       $sendCmd >> ../../tr_run_$tt.log 2>&1
304    
305      sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
306    ;;
307    
308    'tapTL')
309    
310      ./testreport -tap -tlm -of ../tools/build_options/linux_amd64_gfortran \
311       $sendCmd >> ../../tr_run_$tt.log 2>&1
312    
313      sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log
314    ;;
315    
316  'g7a')  'g7a')
317    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22