Skip to content

Commit

Permalink
Attempt at solving Torque hold-for-array trouble
Browse files Browse the repository at this point in the history
  • Loading branch information
rstraver committed Nov 20, 2014
1 parent fa32668 commit 7ca33c7
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions submit/torque.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,40 @@ submit() {
HOLDFOR=""
if [ ${#REQS} -ne "0" ]
then
HOLDFOR=`getHoldIds`
HOLDFOR=${HOLDFOR//;/:}
HOLDFOR="-W depend=afterok$HOLDFOR"
HOLDFORIDS=`getHoldIds`
#HOLDFOR=${HOLDFOR//;/:}
#HOLDFOR="-W depend=afterok$HOLDFOR"


HOLDFOR_ARRAY=""
HOLDFOR_SINGLE=""
IFS=';' read -a HOLDFOR_ARR <<< "$HOLDFORIDS"
for HOLDJOB in ${HOLDFOR_ARR[@]}
do
TEMPVAL=`echo $HOLDJOB|cut -d "." -f1`
if [ ${TEMPVAL: -2} = '[]' ];
then
HOLDFOR_ARRAY="$HOLDFOR_ARRAY:$HOLDJOB"
else
HOLDFOR_SINGLE="$HOLDFOR_SINGLE:$HOLDJOB"
fi
done

if [ ! $HOLDFOR_SINGLE = "" ]
then
HOLDFOR="$HOLDFOR -W depend=afterok$HOLDFOR_SINGLE"
fi

if [ ! $HOLDFOR_ARRAY = "" ]
then
HOLDFOR="$HOLDFOR -W depend=afterokarray$HOLDFOR_ARRAY"
fi

fi




# Submit to Torque
JOBID=`qsub \
$HOLDFOR \
Expand Down

0 comments on commit 7ca33c7

Please sign in to comment.