Skip to content

Commit

Permalink
In restart_from_step, fix #35 (remove everything after _ in SLURM's j…
Browse files Browse the repository at this point in the history
…obids) and avoid requeue wrong job with same name ending (e.g. end and Illumina_pair_end)
  • Loading branch information
lentendu committed Jun 25, 2018
1 parent 92d2f0d commit 3c48ae0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Slurm/deltamp.restart_from_step
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fi
while read var val; do unset $var ; if [[ $val == "(["* ]]; then declare -A $var="`echo $val | sed 's/].\"/]=\"/g'`" ; else declare $var="$val" ; fi ; done < config/env.txt

# Delete jobs from the queue
TO_DEL=`squeue -o "%.i %.j" | grep $(eval echo $DELTAMP_VER.{$(echo ${TO_CLEAN[@]} | sed 's/ /,/g')}.$SUBPROJECT | sed 's/ /\\\|/g') | awk '{print $1}'`
TO_DEL=`squeue -o "%.i %.j" | grep $(eval echo $DELTAMP_VER.{$(echo ${TO_CLEAN[@]} | sed 's/ /,/g')}.$SUBPROJECT | sed 's/ /\\\|/g') | awk '{print $1}' | cut -d "_" -f 1`
if [ ! -z "$TO_DEL" ]
then
scancel $TO_DEL
Expand Down Expand Up @@ -108,7 +108,7 @@ if [ ! -z "$TO_DEL_F" ] ; then rm $TO_DEL_F ; fi
if [ ! -z "$TO_DEL_D" ] ; then rmdir $TO_DEL_D ; fi

# Remove unnecessary dependencies and re-queue from STEP
sed -n '/'$STEP'\.sh)/,$p' config/steps.final > steps.tmp
sed -n '\@ '$BIN/$STEP'\.sh)$@,$p' config/steps.final > steps.tmp
AVOID=$(sed -n '1,/'$UNTIL'\.sh)$/p' config/steps.final | awk 'BEGIN{FS="="}$0!~"^#"{if($0~" -a "){print "${"$1"%.*}"} else print "${"$1"}"}')
for i in $AVOID; do sed 's/:'$i'//' steps.tmp > steps.tmp2 && mv steps.tmp2 steps.tmp ; done
. <(sed 's/ -d afterok / /' steps.tmp)
Expand Down

0 comments on commit 3c48ae0

Please sign in to comment.