我正在尝试学习 slurm 系统,但我在理解上有些困难。我正在尝试使用 sbatch 中的 --array 参数并行运行一堆作业。我希望作业分布在多个节点上,但考虑到时间戳,它们似乎都在同一个节点上运行。
我正在使用的 sbatch 命令:
sbatch -N 10 -a 0-19 --cpus-per-task 10 test.sh
正在运行的 test.sh 文件:
#!/usr/bin/env bash
#SBATCH -o test_%a.out
#SBATCH -p all.q
#SBATCH --time=1:00:00
srun --cpus-per-task 10 -k --exclusive --ntasks 1 -N 1 echo "`date ` array_index: $SLURM_ARRAY_TASK_ID node: $SLURM_NODEID requested nodes: $SLURM_NNODES `sleep 3`"
输出文件:
Thu Feb 12 19:51:28 UTC 2015 array_index: 0 node: 0 requested nodes: 10
Thu Feb 12 19:51:45 UTC 2015 array_index: 10 node: 0 requested nodes: 10
Thu Feb 12 19:51:45 UTC 2015 array_index: 11 node: 0 requested nodes: 10
Thu Feb 12 19:51:49 UTC 2015 array_index: 12 node: 0 requested nodes: 10
Thu Feb 12 19:51:49 UTC 2015 array_index: 13 node: 0 requested nodes: 10
Thu Feb 12 19:51:52 UTC 2015 array_index: 14 node: 0 requested nodes: 10
Thu Feb 12 19:51:52 UTC 2015 array_index: 15 node: 0 requested nodes: 10
Thu Feb 12 19:51:56 UTC 2015 array_index: 16 node: 0 requested nodes: 10
Thu Feb 12 19:51:56 UTC 2015 array_index: 17 node: 0 requested nodes: 10
Thu Feb 12 19:51:59 UTC 2015 array_index: 18 node: 0 requested nodes: 10
Thu Feb 12 19:51:59 UTC 2015 array_index: 19 node: 0 requested nodes: 10
Thu Feb 12 19:51:28 UTC 2015 array_index: 1 node: 0 requested nodes: 10
Thu Feb 12 19:51:32 UTC 2015 array_index: 2 node: 0 requested nodes: 10
Thu Feb 12 19:51:32 UTC 2015 array_index: 3 node: 0 requested nodes: 10
Thu Feb 12 19:51:35 UTC 2015 array_index: 4 node: 0 requested nodes: 10
Thu Feb 12 19:51:35 UTC 2015 array_index: 5 node: 0 requested nodes: 10
Thu Feb 12 19:51:39 UTC 2015 array_index: 6 node: 0 requested nodes: 10
Thu Feb 12 19:51:39 UTC 2015 array_index: 7 node: 0 requested nodes: 10
Thu Feb 12 19:51:42 UTC 2015 array_index: 8 node: 0 requested nodes: 10
Thu Feb 12 19:51:42 UTC 2015 array_index: 9 node: 0 requested nodes: 10