/[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.5 by jmc, Thu Dec 29 22:05:32 2016 UTC revision 1.12 by jmc, Sun Feb 19 16:50:34 2017 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'
  #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
15    
16    headNode=`hostname -s`
17  #QSUB="qsub"  #QSUB="qsub"
18  #QSTAT="qstat"  #QSTAT="qstat -u $USER"
19  #dNam=`hostname -s`  #dNam=$headNode
20  QSUB="/usr/bin/sbatch"  QSUB="/usr/bin/sbatch"
21  QSTAT="/usr/bin/qstat"  #QSTAT="/usr/bin/qstat -u $USER"
22    QLIST="/usr/bin/squeue -u $USER"
23  dNam='svante'  dNam='svante'
24  HERE="$HOME/test_${dNam}"  HERE="$HOME/test_${dNam}"
25  TST_DISK="/net/fs09/d0"  TST_DISK="/net/fs09/d0/jm_c"
26  TST_DIR="$TST_DISK/jm_c/test_${dNam}"  TST_DIR="$TST_DISK/test_${dNam}"
27  logPfix='test_submit'  logPfix='test_submit'
28    
29  SUB_DIR="$HERE/$dNam"  SUB_DIR="$HERE/$dNam"
# Line 74  updFile='updated_code' Line 75  updFile='updated_code'
75  echo "cd $TST_DISK ; pwd (x2)" | tee -a $LOG_FIL  echo "cd $TST_DISK ; pwd (x2)" | tee -a $LOG_FIL
76  cd $TST_DISK    | tee -a $LOG_FIL 2>&1  cd $TST_DISK    | tee -a $LOG_FIL 2>&1
77  pwd             | tee -a $LOG_FIL  pwd             | tee -a $LOG_FIL
 sleep 30  
 pwd             | tee -a $LOG_FIL  
78  if test ! -d $TST_DIR ; then  if test ! -d $TST_DIR ; then
79     echo -n "Creating a working dir: $TST_DIR ..."       | tee -a $LOG_FIL     echo -n "Creating a working dir: $TST_DIR ..."       | tee -a $LOG_FIL
80    #/bin/rm -rf $TST_DIR    #/bin/rm -rf $TST_DIR
# Line 87  if test ! -d $TST_DIR ; then Line 86  if test ! -d $TST_DIR ; then
86     fi     fi
87  fi  fi
88  cd $TST_DIR  cd $TST_DIR
89    pwd             | tee -a $LOG_FIL
90    
91  #- remove date/lock-file:  #- remove date/lock-file:
92  if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi  if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi
# Line 144  cd $OUT_DIR Line 144  cd $OUT_DIR
144    for i in $JOB_LIST    for i in $JOB_LIST
145    do    do
146      case $i in      case $i in
147          'ifcMPI') sfx='ifc_mpi' ;;
148        'pgiMPI') sfx='pgi_mpi' ;;        'pgiMPI') sfx='pgi_mpi' ;;
149        'pgiAdm') sfx='pgi_adm' ;;        'pgiAdm') sfx='pgi_adm' ;;
150               *) sfx=${i}'_mpi'  ;;               *) sfx=${i}'_mpi'  ;;
151      esac      esac
152      BATCH_SCRIPT="test_svante_$sfx"      BATCH_SCRIPT="test_svante_$sfx"
153      if test -f $SUB_DIR/$BATCH_SCRIPT ; then      if test -f $SUB_DIR/$BATCH_SCRIPT ; then
154          #- job name ( $JOB ) & output-file name ( $JOB.std??? ) must match
155          #  definition within $BATCH_SCRIPT slurm script
156        JOB="tst_"$i        JOB="tst_"$i
157        job_exist=`$QSTAT -a | grep $USER | grep $JOB | wc -l`        sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c
158          #job_exist=`$QSTAT | grep $JOB | wc -l`
159          job_exist=`$QLIST | grep $sJob | wc -l`
160        if test "x_$job_exist" = x_0 ; then        if test "x_$job_exist" = x_0 ; then
161          #-- move previous output file          #-- move previous output file
162          outList=`ls $JOB.std??? 2> /dev/null`          outList=`ls $JOB.std??? 2> /dev/null`
# Line 176  cd $OUT_DIR Line 181  cd $OUT_DIR
181            NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1`            NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1`
182        else        else
183            echo "--> $JOB :"                             | tee -a $LOG_FIL            echo "--> $JOB :"                             | tee -a $LOG_FIL
184            $QSTAT -a | grep $USER | grep $JOB            | tee -a $LOG_FIL            #$QSTAT | grep $JOB                           | tee -a $LOG_FIL
185              $QLIST | grep $sJob                           | tee -a $LOG_FIL
186            echo ' job already exist => skip this test'   | tee -a $LOG_FIL            echo ' job already exist => skip this test'   | tee -a $LOG_FIL
187        fi        fi
188      else      else

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

  ViewVC Help
Powered by ViewVC 1.1.22