| 23 |
fi |
fi |
| 24 |
|
|
| 25 |
QSUB="/usr/bin/sbatch" |
QSUB="/usr/bin/sbatch" |
| 26 |
#QSTAT="/usr/bin/qstat -u $USER" |
#QLIST="/usr/bin/qstat -u $USER" |
| 27 |
QLIST="/usr/bin/squeue -u $USER" |
QLIST="/usr/bin/squeue -u $USER" |
| 28 |
dNam='engaging' |
dNam='engaging' |
| 29 |
HERE="$HOME/test_$dNam" |
HERE="$HOME/test_$dNam" |
| 69 |
# definition within $BATCH_SCRIPT slurm script |
# definition within $BATCH_SCRIPT slurm script |
| 70 |
JOB="${i}_tst" |
JOB="${i}_tst" |
| 71 |
sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c |
sJob=`printf "%8.8s" $JOB` #- squeue truncate name to only 1rst 8c |
| 72 |
#job_exist=`$QSTAT | grep $JOB | wc -l` |
#job_exist=`$QLIST | grep $JOB | wc -l` |
| 73 |
job_exist=`$QLIST | grep $sJob | wc -l` |
job_exist=`$QLIST | grep $sJob | wc -l` |
| 74 |
if test "x_$job_exist" = x_0 ; then |
if test "x_$job_exist" = x_0 ; then |
| 75 |
#-- move previous output file |
#-- move previous output file |
| 76 |
outList=`ls $JOB.std??? 2> /dev/null` |
outList=`ls $JOB.std??? 2> /dev/null` |
| 77 |
if test "x$outList" != x ; then |
if test "x$outList" != x ; then |
| 78 |
echo -n " moving job $JOB old output files:" | tee -a $LOG_FIL |
echo -n " moving job "$JOB" old output files:"| tee -a $LOG_FIL |
| 79 |
if test -d $OUT_DIR/prev ; then |
if test -d $OUT_DIR/prev ; then |
| 80 |
for xx in $outList ; do |
for xx in $outList ; do |
| 81 |
pp=$OUT_DIR/prev/$xx ; echo -n " $xx" | tee -a $LOG_FIL |
pp=$OUT_DIR/prev/$xx ; echo -n " $xx" | tee -a $LOG_FIL |
| 90 |
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 |
| 91 |
fi |
fi |
| 92 |
#-- submit job |
#-- submit job |
| 93 |
echo -n "--> $JOB : " | tee -a $LOG_FIL |
echo -n "--> $JOB : $BATCH_SCRIPT , " | tee -a $LOG_FIL |
| 94 |
$QSUB $SUB_DIR/$BATCH_SCRIPT | tee -a $LOG_FIL |
$QSUB $SUB_DIR/$BATCH_SCRIPT | tee -a $LOG_FIL |
| 95 |
NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1` |
NB_SUB_JOBS=`expr $NB_SUB_JOBS + 1` |
| 96 |
else |
else |
| 97 |
echo "--> $JOB :" | tee -a $LOG_FIL |
echo "--> $JOB :" | tee -a $LOG_FIL |
|
#$QSTAT | grep $JOB | tee -a $LOG_FIL |
|
| 98 |
$QLIST | grep $sJob | tee -a $LOG_FIL |
$QLIST | grep $sJob | tee -a $LOG_FIL |
| 99 |
echo ' job already exist => skip this test' | tee -a $LOG_FIL |
echo ' job already exist => skip this test' | tee -a $LOG_FIL |
| 100 |
fi |
fi |
| 102 |
echo 'no file:' $BATCH_SCRIPT 'to submit' | tee -a $LOG_FIL |
echo 'no file:' $BATCH_SCRIPT 'to submit' | tee -a $LOG_FIL |
| 103 |
fi |
fi |
| 104 |
done |
done |
| 105 |
echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'" >> $LOG_FIL |
#echo "info-sub-list: NB_SUB_JOBS='$NB_SUB_JOBS'" >> $LOG_FIL |
| 106 |
|
echo "Submitted $NB_SUB_JOBS jobs from dir: $SUB_DIR" | tee -a $LOG_FIL |
| 107 |
echo -n '-- Finished at: ' | tee -a $LOG_FIL |
echo -n '-- Finished at: ' | tee -a $LOG_FIL |
| 108 |
date | tee -a $LOG_FIL |
date | tee -a $LOG_FIL |
| 109 |
|
|