简体   繁体   English

SLURM 批处理数组循环?

[英]SLURM batch array loop?

I'm somewhat bash challenged and trying to send a large job array through slurm on my institution's cluster.我在某种程度上受到了挑战,并试图通过我机构集群上的 slurm 发送一个大型作业数组。 I am way over my limit (which appears to be 1000 jobs per job array) and am having to iteratively parse out the list into blocks of 1000, which is tedious:我已经超出了我的限制(每个作业数组似乎是 1000 个作业)并且我不得不迭代地将列表解析为 1000 个块,这很乏味:

sbatch --array=17001-18000 -p <server-name> --time=12:00:00 <my-bash-script>

How might I write a loop to do this?我如何编写一个循环来做到这一点? Each job takes about 11 minutes, so I would need to build in a pause in the loop.每项工作大约需要 11 分钟,所以我需要在循环中暂停。 Otherwise, I suspect SLURM will reject the new batch job.否则,我怀疑 SLURM 会拒绝新的批处理作业。 Anyone out there know what to do?有大佬知道怎么办吗? Thanks in advance!提前致谢!

Something like this should do what you want这样的事情应该做你想做的

START=1
END=10000
STEP=1000
SLEEP=700 #Just over 11 Minutes (in seconds)

for i in $(seq $START $STEP $END) ; do
    JSTART=$i
    JEND=$[ $JSTART + $STEP - 1 ] 
    echo "Submitting with ${JSTART} and ${JEND}"
    sbatch --array=${JSTART}-${JEND} -p <server-name> --time=12:00:00 <my-bash-script>
    sleep $SLEEP
done

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM