/[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.24 by jmc, Tue Apr 28 14:34:46 2020 UTC revision 1.26 by jmc, Sun Feb 19 14:56:32 2023 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='ifcMPI ifcAdm pgiMPI pgiAdm pgiMth'    TEST_LIST='ifcMpi ifcAdm pgiMpi pgiAdm pgiMth'
12  else  else
13    TEST_LIST=$*    TEST_LIST=$*
14  fi  fi
15    
16  headNode=`hostname -s`  headNode=`hostname -s`
17  #QSUB="qsub"  #QSUB="qsub"
18  #QSTAT="qstat -u $USER"  #QLIST="qstat -u $USER"
19  #dNam=$headNode  #dNam=$headNode
20  QSUB="/usr/bin/sbatch"  QSUB="/usr/bin/sbatch"
21  QLIST="/usr/bin/squeue -u $USER"  QLIST="/usr/bin/squeue -u $USER"
# Line 201  cd $OUT_DIR Line 201  cd $OUT_DIR
201    NB_SUB_JOBS=0    NB_SUB_JOBS=0
202    for i in $JOB_LIST    for i in $JOB_LIST
203    do    do
204      case $i in      sfx=`echo ${i} | sed 's/^.../&_/' | tr '[:upper:]' '[:lower:]'`
       'pgiMth') sfx='pgi_mth' ;;  
              *) sfx=`echo ${i} | sed 's/MPI$/_mpi/' | sed 's/Adm$/_adm/'` ;;  
     esac  
205      BATCH_SCRIPT="test_${dNam}_$sfx"      BATCH_SCRIPT="test_${dNam}_$sfx"
206      if test -f $SUB_DIR/$BATCH_SCRIPT ; then      if test -f $SUB_DIR/$BATCH_SCRIPT ; then
207        #- job name ( $JOB ) & output-file name ( $JOB.std??? ) must match        #- job name ( $JOB ) & output-file name ( $JOB.std??? ) must match
208        #  definition within $BATCH_SCRIPT slurm script        #  definition within $BATCH_SCRIPT slurm script
209        JOB="${i}_tst"        JOB="${i}_tst"
210        sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c        sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c
211        #job_exist=`$QSTAT | grep $JOB | wc -l`        #job_exist=`$QLIST | grep $JOB | wc -l`
212        job_exist=`$QLIST | grep $sJob | wc -l`        job_exist=`$QLIST | grep $sJob | wc -l`
213        if test "x_$job_exist" = x_0 ; then        if test "x_$job_exist" = x_0 ; then
214          #-- move previous output file          #-- move previous output file
# Line 232  cd $OUT_DIR Line 229  cd $OUT_DIR
229          else echo " no old output files from job '$JOB'" | tee -a $LOG_FIL          else echo " no old output files from job '$JOB'" | tee -a $LOG_FIL
230          fi          fi
231          #-- submit job          #-- submit job
232            echo -n "--> $JOB : "                         | tee -a $LOG_FIL            echo -n "--> $JOB : $BATCH_SCRIPT , "         | tee -a $LOG_FIL
233            $QSUB $SUB_DIR/$BATCH_SCRIPT                  | tee -a $LOG_FIL            $QSUB $SUB_DIR/$BATCH_SCRIPT                  | tee -a $LOG_FIL
234            NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1`            NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1`
235            sleep 1            sleep 1
236        else        else
237            echo "--> $JOB :"                             | tee -a $LOG_FIL            echo "--> $JOB :"                             | tee -a $LOG_FIL
           #$QSTAT | grep $JOB                           | tee -a $LOG_FIL  
238            $QLIST | grep $sJob                           | tee -a $LOG_FIL            $QLIST | grep $sJob                           | tee -a $LOG_FIL
239            echo ' job already exist => skip this test'   | tee -a $LOG_FIL            echo ' job already exist => skip this test'   | tee -a $LOG_FIL
240        fi        fi
# Line 246  cd $OUT_DIR Line 242  cd $OUT_DIR
242         echo 'no file:' $BATCH_SCRIPT 'to submit'        | tee -a $LOG_FIL         echo 'no file:' $BATCH_SCRIPT 'to submit'        | tee -a $LOG_FIL
243      fi      fi
244    done    done
245    echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'"      >> $LOG_FIL    #echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'"     >> $LOG_FIL
246      echo "Submitted $NB_SUB_JOBS jobs from dir: $SUB_DIR" | tee -a $LOG_FIL
247    echo -n '-- Finished at: '                            | tee -a $LOG_FIL    echo -n '-- Finished at: '                            | tee -a $LOG_FIL
248    date                                                  | tee -a $LOG_FIL    date                                                  | tee -a $LOG_FIL
249    

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.22