/[MITgcm]/MITgcm_contrib/test_scripts/svante/test_submit_svante
ViewVC logotype

Diff of /MITgcm_contrib/test_scripts/svante/test_submit_svante

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

revision 1.10 by jmc, Mon Jan 16 14:20:00 2017 UTC revision 1.17 by jmc, Mon Feb 5 13:36:05 2018 UTC
# Line 8  dInWeek=`date +%a` Line 8  dInWeek=`date +%a`
8    
9  if test $# = 0  if test $# = 0
10  then  then
11    TEST_LIST='pgiMPI'    TEST_LIST='ifcMPI pgiMPI pgiAdm pgiMth'
  #if test "x$dInWeek" = xSun ; then TEST_LIST="$TEST_LIST iad ifc oad" ; fi  
12  else  else
13    TEST_LIST=$*    TEST_LIST=$*
14  fi  fi
# Line 19  headNode=`hostname -s` Line 18  headNode=`hostname -s`
18  #QSTAT="qstat -u $USER"  #QSTAT="qstat -u $USER"
19  #dNam=$headNode  #dNam=$headNode
20  QSUB="/usr/bin/sbatch"  QSUB="/usr/bin/sbatch"
 #QSTAT="/usr/bin/qstat -u $USER"  
21  QLIST="/usr/bin/squeue -u $USER"  QLIST="/usr/bin/squeue -u $USER"
22  dNam='svante'  dNam='svante'
23  HERE="$HOME/test_${dNam}"  HERE="$HOME/test_${dNam}"
24  TST_DISK="/net/fs09/d0/jm_c"  TST_DISK="/net/fs09/d1/jm_c"
25  TST_DIR="$TST_DISK/test_${dNam}"  TST_DIR="$TST_DISK/test_${dNam}"
26  logPfix='test_submit'  #- where local copy of code is (need to be consistent with run-job scripts):
27    #srcDIR=$TST_DIR
28    srcDIR=$HERE
29    srcCode="MITgcm_today"
30    
31    logPfix='test_submit'
32  SUB_DIR="$HERE/$dNam"  SUB_DIR="$HERE/$dNam"
33  OUT_DIR="$HERE/output"  OUT_DIR="$HERE/output"
34  LOG_FIL="$OUT_DIR/$logPfix."`date +%m%d`".log"  LOG_FIL="$OUT_DIR/$logPfix."`date +%m%d`".log"
# Line 69  cmdCVS='cvs -d :pserver:cvsanon@mitgcm.o Line 71  cmdCVS='cvs -d :pserver:cvsanon@mitgcm.o
71  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
72  #-- Download/Update reference version of MITgcm code:  #-- Download/Update reference version of MITgcm code:
73  checkOut=1  checkOut=1
 gcmDIR='MITgcm'  
74  exp2add=''  exp2add=''
75  updFile='updated_code'  updFile='updated_code'
76    
77  echo "cd $TST_DISK ; pwd (x2)" | tee -a $LOG_FIL  if test $srcDIR = $TST_DIR ; then
78  cd $TST_DISK    | tee -a $LOG_FIL 2>&1    echo "cd $TST_DISK ; pwd (x2)" | tee -a $LOG_FIL
79  pwd             | tee -a $LOG_FIL    cd $TST_DISK  | tee -a $LOG_FIL 2>&1
80  if test ! -d $TST_DIR ; then    pwd           | tee -a $LOG_FIL
81     echo -n "Creating a working dir: $TST_DIR ..."       | tee -a $LOG_FIL  fi
82    #/bin/rm -rf $TST_DIR  if test ! -d $srcDIR ; then
83     mkdir $TST_DIR     echo -n "Creating a working dir: $srcDIR ..."        | tee -a $LOG_FIL
84      #/bin/rm -rf $srcDIR
85       mkdir $srcDIR
86     retVal=$?     retVal=$?
87     if test "x$retVal" != x0 ; then     if test "x$retVal" != x0 ; then
88        echo "Error: unable to make dir: $TST_DIR (err=$retVal ) --> Exit" | tee -a $LOG_FIL        echo "Error: unable to make dir: $srcDIR (err=$retVal ) --> Exit" | tee -a $LOG_FIL
89        exit 1        exit 1
90     fi     fi
91  fi  fi
92  cd $TST_DIR  cd $srcDIR
93  pwd             | tee -a $LOG_FIL  pwd             | tee -a $LOG_FIL
94    
95  #- remove date/lock-file:  #- remove date/lock-file:
96  if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi  if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi
97    
98  if [ $checkOut -eq 1 ] ; then  if [ $checkOut -eq 1 ] ; then
99    if test -d $gcmDIR/CVS ; then    if test -d $srcCode/CVS ; then
100      echo -n "Update dir $gcmDIR using '$cmdCVS update -P -d' ..." | tee -a $LOG_FIL      echo -n "Update dir $srcCode using '$cmdCVS update -P -d' ..." | tee -a $LOG_FIL
101      echo '' >> $LOG_FIL      echo '' >> $LOG_FIL
102      ( cd $gcmDIR ; $cmdCVS update -P -d )               >> $LOG_FIL 2>&1      ( cd $srcCode ; $cmdCVS update -P -d )              >> $LOG_FIL 2>&1
103      RETVAL=$?      RETVAL=$?
104      if test "x$RETVAL" != x0 ; then echo ''      if test "x$RETVAL" != x0 ; then echo ''
105         echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" | tee -a $LOG_FIL         echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" | tee -a $LOG_FIL
# Line 104  if [ $checkOut -eq 1 ] ; then Line 107  if [ $checkOut -eq 1 ] ; then
107      else echo "  done"                                  | tee -a $LOG_FIL      else echo "  done"                                  | tee -a $LOG_FIL
108      fi      fi
109   else   else
110      echo "no dir: $gcmDIR/CVS => try a fresh check-out" | tee -a $LOG_FIL      echo "no dir: $srcCode/CVS => try a fresh check-out"        | tee -a $LOG_FIL
111      checkOut=2      checkOut=2
112    fi    fi
113  fi  fi
114  if [ $checkOut -eq 2 ] ; then  if [ $checkOut -eq 2 ] ; then
115      test -e $gcmDIR && rm -rf $gcmDIR      test -e $srcCode && rm -rf $srcCode
116      echo -n "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..."   | tee -a $LOG_FIL      echo -n "Downloading using '$cmdCVS co -P -d $srcCode MITgcm' ..."  | tee -a $LOG_FIL
117      $cmdCVS co -P -d $gcmDIR MITgcm > /dev/null      $cmdCVS co -P -d $srcCode MITgcm > /dev/null
118      RETVAL=$?      RETVAL=$?
119      if test "x$RETVAL" != x0 ; then echo ''             | tee -a $LOG_FIL      if test "x$RETVAL" != x0 ; then echo ''             | tee -a $LOG_FIL
120        echo "cvs co on '"`hostname`"' fail (return val=$RETVAL) => exit" | tee -a $LOG_FIL        echo "cvs co on '"`hostname`"' fail (return val=$RETVAL) => exit" | tee -a $LOG_FIL
121        exit        exit
122      else echo "  done"                                  | tee -a $LOG_FIL      else echo "  done"                                  | tee -a $LOG_FIL
123      fi      fi
124      if test -d $gcmDIR/verification ; then      if test -d $srcCode/verification ; then
125        for exp2add in $addExp ; do        for exp2add in $addExp ; do
126          echo " add dir: $exp2add (from Contrib:verification_other)" | tee -a $LOG_FIL          echo " add dir: $exp2add (from Contrib:verification_other)" | tee -a $LOG_FIL
127          ( cd $gcmDIR/verification ; $cmdCVS co -P -d $exp2add \          ( cd $srcCode/verification ; $cmdCVS co -P -d $exp2add \
128                         MITgcm_contrib/verification_other/$exp2add > /dev/null )                         MITgcm_contrib/verification_other/$exp2add > /dev/null )
129        done        done
130      fi      fi
131      /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs      /usr/bin/find $srcCode -type d | xargs chmod g+rxs
132      /usr/bin/find $gcmDIR -type f | xargs chmod g+r      /usr/bin/find $srcCode -type f | xargs chmod g+r
133  fi  fi
134    
135  #- update date/lock-file:  #- update date/lock-file:
136  if test -d $gcmDIR/verification ; then  if test -d $srcCode/verification ; then
137    echo $today > $updFile ; sleep 2    echo $today > $updFile ; sleep 2
138    ls -l $updFile                                        | tee -a $LOG_FIL    ls -l $updFile                                        | tee -a $LOG_FIL
139  fi  fi
# Line 145  cd $OUT_DIR Line 148  cd $OUT_DIR
148    for i in $JOB_LIST    for i in $JOB_LIST
149    do    do
150      case $i in      case $i in
       'pgiMPI') sfx='pgi_mpi' ;;  
151        'pgiAdm') sfx='pgi_adm' ;;        'pgiAdm') sfx='pgi_adm' ;;
152               *) sfx=${i}'_mpi'  ;;        'pgiMth') sfx='pgi_mth' ;;
153                 *) sfx=`echo ${i} | sed 's/MPI$/_mpi/'`  ;;
154      esac      esac
155      BATCH_SCRIPT="test_svante_$sfx"      BATCH_SCRIPT="test_${dNam}_$sfx"
156      if test -f $SUB_DIR/$BATCH_SCRIPT ; then      if test -f $SUB_DIR/$BATCH_SCRIPT ; then
157        #- job name ( $JOB ) & output-file name ( $JOB.std??? ) must match        #- job name ( $JOB ) & output-file name ( $JOB.std??? ) must match
158        #  definition within $BATCH_SCRIPT slurm script        #  definition within $BATCH_SCRIPT slurm script
159        JOB="tst_"$i        JOB="${i}_tst"
160        sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c        sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c
161        #job_exist=`$QSTAT | grep $JOB | wc -l`        #job_exist=`$QSTAT | grep $JOB | wc -l`
162        job_exist=`$QLIST | grep $sJob | wc -l`        job_exist=`$QLIST | grep $sJob | wc -l`

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

  ViewVC Help
Powered by ViewVC 1.1.22