Skip to content

Commit

Permalink
Added slurm job submission support
Browse files Browse the repository at this point in the history
  • Loading branch information
rstraver committed Mar 1, 2016
1 parent 26fa9f1 commit e3d9efd
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions submit/slurm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SLURM translator
submit() {
echo ${ARGS[@]}
for ARG in ${ARGS[@]}
do
ANAME=`echo $ARG | cut -d ':' -f1`
AVAL=`echo $ARG | cut -d ':' -f2`
if [ $ANAME = "cpu" ]
then
SUBARGS="$SUBARGS -c $(($AVAL<$ARG_JOB_CPU_MAX?$AVAL:$ARG_JOB_CPU_MAX))"
fi

if [ $ANAME = "array" ]
then
SUBARGS="$SUBARGS -a ${AVAL//,/:}"
fi
done

# Obtain hold ids, replace splitting tag by actual arguments
HOLDFOR=""
if [ ${#REQS} -ne "0" ]
then
HOLDFOR=`getHoldIds`
HOLDFOR=${HOLDFOR//;/,}
HOLDFOR="-d ${HOLDFOR/,/}"
fi

# Submit to SGE
JOBID=`sbatch \
$HOLDFOR \
-J $JOB_NAME \
-e $FILE_LOG_ERR \
-o $FILE_LOG_OUT \
$SUBARGS \
$NODE \
$ADDS`

# Fix the JobID
JOBID=`echo $JOBID | cut -d\ -f4`
}

0 comments on commit e3d9efd

Please sign in to comment.