/[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.25 by jmc, Tue May 11 16:32:29 2021 UTC
# Line 15  fi Line 15  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 211  cd $OUT_DIR Line 211  cd $OUT_DIR
211        #  definition within $BATCH_SCRIPT slurm script        #  definition within $BATCH_SCRIPT slurm script
212        JOB="${i}_tst"        JOB="${i}_tst"
213        sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c        sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c
214        #job_exist=`$QSTAT | grep $JOB | wc -l`        #job_exist=`$QLIST | grep $JOB | wc -l`
215        job_exist=`$QLIST | grep $sJob | wc -l`        job_exist=`$QLIST | grep $sJob | wc -l`
216        if test "x_$job_exist" = x_0 ; then        if test "x_$job_exist" = x_0 ; then
217          #-- move previous output file          #-- move previous output file
# Line 232  cd $OUT_DIR Line 232  cd $OUT_DIR
232          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
233          fi          fi
234          #-- submit job          #-- submit job
235            echo -n "--> $JOB : "                         | tee -a $LOG_FIL            echo -n "--> $JOB : $BATCH_SCRIPT , "         | tee -a $LOG_FIL
236            $QSUB $SUB_DIR/$BATCH_SCRIPT                  | tee -a $LOG_FIL            $QSUB $SUB_DIR/$BATCH_SCRIPT                  | tee -a $LOG_FIL
237            NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1`            NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1`
238            sleep 1            sleep 1
239        else        else
240            echo "--> $JOB :"                             | tee -a $LOG_FIL            echo "--> $JOB :"                             | tee -a $LOG_FIL
           #$QSTAT | grep $JOB                           | tee -a $LOG_FIL  
241            $QLIST | grep $sJob                           | tee -a $LOG_FIL            $QLIST | grep $sJob                           | tee -a $LOG_FIL
242            echo ' job already exist => skip this test'   | tee -a $LOG_FIL            echo ' job already exist => skip this test'   | tee -a $LOG_FIL
243        fi        fi
# Line 246  cd $OUT_DIR Line 245  cd $OUT_DIR
245         echo 'no file:' $BATCH_SCRIPT 'to submit'        | tee -a $LOG_FIL         echo 'no file:' $BATCH_SCRIPT 'to submit'        | tee -a $LOG_FIL
246      fi      fi
247    done    done
248    echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'"      >> $LOG_FIL    #echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'"     >> $LOG_FIL
249      echo "Submitted $NB_SUB_JOBS jobs from dir: $SUB_DIR" | tee -a $LOG_FIL
250    echo -n '-- Finished at: '                            | tee -a $LOG_FIL    echo -n '-- Finished at: '                            | tee -a $LOG_FIL
251    date                                                  | tee -a $LOG_FIL    date                                                  | tee -a $LOG_FIL
252    

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

  ViewVC Help
Powered by ViewVC 1.1.22