Skip to content

Instantly share code, notes, and snippets.

@wtbarnes
Created August 27, 2015 18:22
Show Gist options
  • Save wtbarnes/e4e967c4ffdc8a12d45b to your computer and use it in GitHub Desktop.
Save wtbarnes/e4e967c4ffdc8a12d45b to your computer and use it in GitHub Desktop.
shell script for starting large number of jobs greater than SLURM policy allows by delaying job array submission by some interval
MAX_NUM=6678
MAX_JOBS=500
DELTA=$((MAX_JOBS - 1))
echo "Beginning job submission on "`date` >> batch_job_status.out
for i in `seq 0 $MAX_JOBS $MAX_NUM`
do
A=$i
B=$((i+DELTA))
if [ $B -gt $MAX_NUM ];
then
D=$((B - MAX_NUM))
B=$((A+DELTA-D))
fi
echo "Submitting jobs $A-$B" >> batch_job_status.out
sbatch --array=$A-$B job_array.slurm >> batch_job_status.out
sleep 100
done
echo "Job submission completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment