/[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.4 by mlosch, Thu Feb 8 15:50:19 2018 UTC revision 1.6 by mlosch, Tue Mar 24 07:40:41 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 33  module load sxc++ Line 33  module load sxc++
33  module load sxmpi  module load sxmpi
34  module load sxnetcdf  module load sxnetcdf
35  #  #
36    module load git
37    #
38  # make sure that we have qsub and qstat  # make sure that we have qsub and qstat
39  #export PATH=${PATH}:/usr/bin/nqsII  #export PATH=${PATH}:/usr/bin/nqsII
40  source /etc/profile.d/nec.sh  source /etc/profile.d/nec.sh
# Line 76  cat << EOF > $HERE/$JOBSCRIPT Line 78  cat << EOF > $HERE/$JOBSCRIPT
78  #  #
79    
80  cd \${PBS_O_WORKDIR}  cd \${PBS_O_WORKDIR}
81  $RUNTESTREPORT -runonly -command "$EXE" >> $MYOUTPUT 2>&1  $RUNTESTREPORT -runonly -command "$EXE" >> ${MYOUTPUT} 2>&1
82    
83  EOF  EOF
84    
85  # clean up old testreport output  # clean up old testreport output
86  if [ -e $MYOUTPUT ]; then  if [ -e ${MYOUTPUT} ]; then
87    rm -rf $MYOUTPUT    rm -rf ${MYOUTPUT}
88  fi  fi
89  if [ -e $OUTFILE ]; then  if [ -e $OUTFILE ]; then
90    rm -r $OUTFILE    rm -r $OUTFILE
# Line 96  fi Line 98  fi
98    
99  checkOut=2  checkOut=2
100    
101    #gitcmd=$HOME/git/git
102    gitcmd=git
103  tmpFil=$TDIR/error.out  tmpFil=$TDIR/error.out
104  if [ $checkOut -le 1 ] ; then  if [ $checkOut -le 1 ] ; then
105    if test -e $TDIR/${gcmDIR}/doc ; then    if test -e $TDIR/${gcmDIR}/doc ; then
# Line 124  if [ $checkOut -ge 2 ] ; then Line 128  if [ $checkOut -ge 2 ] ; then
128      test -e $TDIR/${gcmDIR}  &&  rm -rf $TDIR/${gcmDIR}      test -e $TDIR/${gcmDIR}  &&  rm -rf $TDIR/${gcmDIR}
129      echo "  done"      echo "  done"
130      echo -n "Make a new clone of $git_code from repo: $git_repo ..."      echo -n "Make a new clone of $git_code from repo: $git_repo ..."
131      git clone https://github.com/$git_repo/${git_code}.git ${gcmDIR} 2> $tmpFil      ${gitcmd} clone https://github.com/$git_repo/${git_code}.git ${gcmDIR} 2> $tmpFil
132      retVal=$?      retVal=$?
133      if test $retVal = 0 ; then      if test $retVal = 0 ; then
134         echo ' --> done!'         echo ' --> done!'
# Line 137  if [ $checkOut -ge 2 ] ; then Line 141  if [ $checkOut -ge 2 ] ; then
141      fi      fi
142    else    else
143      echo "Updating current clone ( $git_code ) ..."      echo "Updating current clone ( $git_code ) ..."
144      ( cd ${gcmDIR}; git checkout master ; git pull )      ( cd ${gcmDIR}; ${gitcmd} checkout master ; ${gitcmd} pull )
145      echo ' --> done!'      retVal=$?
146        if test $retVal = 0 ; then
147            echo ' --> done!'
148        else
149            echo " Error: 'git pull' returned: $retVal"
150            echo " Error: 'git pull' returned: $retVal" \
151                | mail -s "Git-error on Stan" Martin.Losch@awi.de
152            exit 2
153        fi
154    fi    fi
155  else  else
156    cd $TDIR    cd $TDIR
# Line 151  unset CC Line 163  unset CC
163  # make sure that do use the cross compiler for testreport  # make sure that do use the cross compiler for testreport
164  #export CC=sxcc  #export CC=sxcc
165    
166  $RUNTESTREPORT  -j 8 -norun > $MYOUTPUT 2>&1  $RUNTESTREPORT  -j 8 -norun > ${MYOUTPUT} 2>&1
167    
168  if [ "$?" != "0" ]  if [ "$?" != "0" ]
169      then      then
# Line 165  if [ "$?" != "0" ] Line 177  if [ "$?" != "0" ]
177  #  rm -rf $TDIR  #  rm -rf $TDIR
178  fi  fi
179    
180  if [ ! -e $MYOUTPUT ]  if [ ! -e ${MYOUTPUT} ]
181      then      then
182      touch $MYOUTPUT      touch ${MYOUTPUT}
183  fi  fi
184    
185  echo " " >> $MYOUTPUT  echo " " >> ${MYOUTPUT}
186  echo "***********************************************************" >> $MYOUTPUT  echo "***********************************************************" >>${MYOUTPUT}
187  echo "Submitting this job script:" >> $MYOUTPUT  echo "Submitting this job script:" >> ${MYOUTPUT}
188  echo "***********************************************************" >> $MYOUTPUT  echo "***********************************************************" >>${MYOUTPUT}
189  cat $HERE/$JOBSCRIPT >> $MYOUTPUT  cat $HERE/$JOBSCRIPT >> ${MYOUTPUT}
190  echo "***********************************************************" >> $MYOUTPUT  echo "***********************************************************" >>${MYOUTPUT}
191  echo "end of job script" >> $MYOUTPUT  echo "end of job script" >> ${MYOUTPUT}
192  echo "***********************************************************" >> $MYOUTPUT  echo "***********************************************************" >>${MYOUTPUT}
193  echo " " >> $MYOUTPUT  echo " " >> ${MYOUTPUT}
194    
195  # 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
196  echo "qsub $HERE/$JOBSCRIPT"  echo "qsub $HERE/$JOBSCRIPT"
# Line 186  qsub $HERE/$JOBSCRIPT Line 198  qsub $HERE/$JOBSCRIPT
198  # 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
199  jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`  jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`
200  while [ "${jobruns}"x != x ]  while [ "${jobruns}"x != x ]
201  do  do
202    sleep 200    sleep 200
203    jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`    jobruns=`qstat -n -u mlosch | grep "$JOBNAME"`
204    echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete"    echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete"
205    currentexp=`grep Experiment $MYOUTPUT | tail -1`    currentexp=`grep Experiment ${MYOUTPUT} | tail -1`
206    echo "currently running $currentexp"    echo "currently running $currentexp"
207  done  done
208    
209  # after running the experiments on the compute node run testreport  # after running the experiments on the compute node run testreport
210  # for a third time to evaluate results on the head node again  # for a third time to evaluate results on the head node again
211  echo " " >> $MYOUTPUT  echo " " >> ${MYOUTPUT}
212  echo "now run testreport for a final time to evaluate results:" >> $MYOUTPUT  echo "now run testreport for a final time to evaluate results:" >> ${MYOUTPUT}
213  echo "$RUNTESTREPORT -match 10 -runonly" >> $MYOUTPUT  echo "$RUNTESTREPORT -match 10 -runonly" >> ${MYOUTPUT}
214  #$RUNTESTREPORT -match 10 -runonly >> $MYOUTPUT 2>&1  #$RUNTESTREPORT -match 10 -runonly >> ${MYOUTPUT} 2>&1
215  $RUNTESTREPORT -match 10 -runonly \  $RUNTESTREPORT -match 10 -runonly \
216      -a "jm_c@mitgcm.org" >> $MYOUTPUT 2>&1      -a "jm_c@mitgcm.org" >> ${MYOUTPUT} 2>&1
217  #   -a "jm_c@mitgcm.org, Martin.Losch@awi.de" >> $MYOUTPUT 2>&1  #   -a "jm_c@mitgcm.org, Martin.Losch@awi.de" >> ${MYOUTPUT} 2>&1
218    
219  echo "end of mitgcmtestreport"  echo "end of mitgcmtestreport"

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22