/[MITgcm]/MITgcm_contrib/test_scripts/sxace/mitgcmtestreport
ViewVC logotype

Diff of /MITgcm_contrib/test_scripts/sxace/mitgcmtestreport

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

revision 1.1 by mlosch, Wed Apr 8 14:28:53 2015 UTC revision 1.5 by mlosch, Mon Mar 23 12:17:57 2020 UTC
# Line 4  Line 4 
4  # 1/ compiling on head node (tx7.awi.de), with -norun option  # 1/ compiling on head node (tx7.awi.de), with -norun option
5  # 2/ running on compute node (using PBS qsub), with -runonly option  # 2/ running on compute node (using PBS qsub), with -runonly option
6  # 3/ evaluating result on head node with -runonly option  # 3/ evaluating result on head node with -runonly option
7  #  #
8  # Notes:  # Notes:
9  # - step 2 leads to many error messages, because the OS on the compute  # - step 2 leads to many error messages, because the OS on the compute
10  #   nodes does not have the appropriate shell tools, modifying the  #   nodes does not have the appropriate shell tools, modifying the
11  #   runonly option to skip the evalution step would be nice but not  #   runonly option to skip the evalution step would be nice but not
# Line 51  JOBSCRIPT=job_${VENDOR} Line 51  JOBSCRIPT=job_${VENDOR}
51  selectexperiment='-t exp2'  selectexperiment='-t exp2'
52  selectexperiment=''  selectexperiment=''
53  # download code into this directory  # download code into this directory
54  TDIR=/ace/scr/mlosch/tmp_$VENDOR  TDIR=/ace/user/mlosch/tmp_$VENDOR
55    gcmDIR=MITgcm
56    git_repo='MITgcm'
57    git_code='MITgcm'
58    
59  OPTFILE=../tools/build_options/SUPER-UX_SX-ACE_sxf90_awi  OPTFILE=../tools/build_options/SUPER-UX_SX-ACE_sxf90_awi
60  OPTFILE=/home/ace/mlosch/MITgcm/tools/build_options/SUPER-UX_SX-ACE_sxf90_awi  #OPTFILE=/home/ace/mlosch/MITgcm/tools/build_options/SUPER-UX_SX-ACE_sxf90_awi
61    
62  RUNTESTREPORT="./testreport $MPI -of=${OPTFILE} $selectexperiment -small_f"  RUNTESTREPORT="./testreport $MPI -of=${OPTFILE} $selectexperiment -small_f"
63  #  #
64  # create batch script  # create batch script
65  #  #
66  cat << EOF > $HERE/$JOBSCRIPT  cat << EOF > $HERE/$JOBSCRIPT
67  ###PBS -q ace-test                         # job queue not neccesary  so far  #PBS -q ace-r                            # job queue
68  #PBS -N $JOBNAME                         # give the job a name  #PBS -N $JOBNAME                         # give the job a name
69  #PBS -l cpunum_job=$NPROCS               # cpus per node  #PBS -l cpunum_job=$NPROCS               # cpus per node
70    #PBS -l elapstim_req=2:00:00
71  #PBS -l cputim_job=2:00:00               # time limit  #PBS -l cputim_job=2:00:00               # time limit
72  #PBS -l memsz_job=32gb                   # max accumulated memory, we need this much because of many netcdf files  #PBS -l memsz_job=32gb                   # max accumulated memory, we need this much because of many netcdf files
73  #PBS -j o                                # join i/o  #PBS -j o                                # join i/o
# Line 83  fi Line 87  fi
87  if [ -e $OUTFILE ]; then  if [ -e $OUTFILE ]; then
88    rm -r $OUTFILE    rm -r $OUTFILE
89  fi  fi
90  if [ -e $TDIR/MITgcm ]; then  
91  # if availabe just update  # checkOut determines how much checking out is being done
92      cd $TDIR/MITgcm  # checkOut = 3: new clone from GitHub and make a new copy
93      cvs -q update -d -P >> cvs_co.log 2>&1  # checkOut = 2: update (git pull) existing repo and make a new copy
94      if [ "$?" != "0" ]; then  # checkOut = 1: skip update
95          cat cvs_co.log  # checkOut = 0: use existing test code (if available otherwise switch to 1)
96      fi  
97  else  checkOut=2
98  # create directory and download code  
99      if [ -e $TDIR ]; then  gitcmd=$HOME/git/git
100          rm -rf $TDIR  tmpFil=$TDIR/error.out
101    if [ $checkOut -le 1 ] ; then
102      if test -e $TDIR/${gcmDIR}/doc ; then
103        echo $TDIR/${gcmDIR}/doc 'exist'
104      else
105        echo -n $TDIR/${gcmDIR} 'missing ; '
106        checkOut=2
107        echo "will make a new copy ( checkOut=$checkOut )"
108      fi
109    fi
110    
111    if [ $checkOut -ge 2 ] ; then
112      #---- cleaning:
113      cd $TDIR
114    
115      #---- Make a new clone or update existing one:
116      if test -e ${gcmDIR}/.git/config ; then
117        echo "${gcmDIR}/.git/config exist"
118      else
119        echo -n "${gcmDIR}/.git/config 'missing, "
120        checkOut=3
121        echo "will get new clone ( checkOut=$checkOut )"
122      fi
123      if [ $checkOut -eq 3 ] ; then
124        echo -n "Removing old clone: $TDIR/${gcmDIR} ..."
125        test -e $TDIR/${gcmDIR}  &&  rm -rf $TDIR/${gcmDIR}
126        echo "  done"
127        echo -n "Make a new clone of $git_code from repo: $git_repo ..."
128        ${gitcmd} clone https://github.com/$git_repo/${git_code}.git ${gcmDIR} 2> $tmpFil
129        retVal=$?
130        if test $retVal = 0 ; then
131           echo ' --> done!'
132           rm -f $tmpFil
133        else
134           echo " Error: 'git clone' returned: $retVal"
135           cat $tmpFil
136           rm -f $tmpFil
137           exit 2
138      fi      fi
139      mkdir $TDIR    else
140      cd $TDIR      echo "Updating current clone ( $git_code ) ..."
141      cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co MITgcm > cvs_co.log 2>&1      ( cd ${gcmDIR}; ${gitcmd} checkout master ; ${gitcmd} pull )
142      if [ "$?" != "0" ]; then      retVal=$?
143          cat cvs_co.log      if test $retVal = 0 ; then
144            echo ' --> done!'
145        else
146            echo " Error: 'git pull' returned: $retVal"
147            echo " Error: 'git pull' returned: $retVal" \
148                | mail -s "Git-error on Stan" Martin.Losch@awi.de
149            exit 2
150      fi      fi
151      fi
152    else
153      cd $TDIR
154  fi  fi
155    
156  cd $TDIR/MITgcm/verification  cd $TDIR/MITgcm/verification
# Line 140  echo "********************************** Line 190  echo "**********************************
190  echo " " >> $MYOUTPUT  echo " " >> $MYOUTPUT
191    
192  # now submit the job that actually runs all the experiments in one go  # now submit the job that actually runs all the experiments in one go
193    echo "qsub $HERE/$JOBSCRIPT"
194  qsub $HERE/$JOBSCRIPT  qsub $HERE/$JOBSCRIPT
195  # keep looking for the job in the job queues and wait until has disappeared  # keep looking for the job in the job queues and wait until has disappeared
196  jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`  jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`
197  while [ "${jobruns}"x != x ]  while [ "${jobruns}"x != x ]
198  do  do
199    sleep 200    sleep 200
200    jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`    jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`
201    echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete"    echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete"
# Line 159  echo "now run testreport for a final tim Line 210  echo "now run testreport for a final tim
210  echo "$RUNTESTREPORT -match 10 -runonly" >> $MYOUTPUT  echo "$RUNTESTREPORT -match 10 -runonly" >> $MYOUTPUT
211  #$RUNTESTREPORT -match 10 -runonly >> $MYOUTPUT 2>&1  #$RUNTESTREPORT -match 10 -runonly >> $MYOUTPUT 2>&1
212  $RUNTESTREPORT -match 10 -runonly \  $RUNTESTREPORT -match 10 -runonly \
213      -a "jmc@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1      -a "jm_c@mitgcm.org" >> $MYOUTPUT 2>&1
214    #   -a "jm_c@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1
215    
216  echo "end of mitgcmtestreport"  echo "end of mitgcmtestreport"

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22