在 SLURM 上提交一系列作业
Submitting an array of jobs on SLURM
我正在尝试在 SLURM 上提交一组作业,但睡眠命令没有按预期工作。我想每 10 秒启动一次工作。但是,此代码等待 10 秒以启动整个作业数组。我应该如何修改以下 bash 文件?
#!/usr/bin/env bash
# The name to show in queue lists for this job:
#SBATCH -J matlab.sh
# Number of desired cpus:
#SBATCH --cpus=1
#SBATCH --mem=8gb
# The time the job will be running:
#SBATCH --time=167:00:00
# To use GPUs you have to request them:
##SBATCH --gres=gpu:1
# If you need nodes with special features uncomment the desired constraint line:
##SBATCH --constraint=bigmem
#SBATCH --constraint=cal
##SBATCH --constraint=slim
# Set output and error files
#SBATCH --error=job.%J.err
#SBATCH --output=job.%J.out
# MAKE AN ARRAY JOB, SLURM_ARRAYID will take values from 1 to 100
#SARRAY --range=1-60
# To load some software (you can show the list with 'module avail'):
module load matlab
export from=400
export to=1000
export steps=60
mkdir temp_${SLURM_ARRAYID}
cd temp_${SLURM_ARRAYID}
# the program to execute with its parameters:
matlab < ../SS.m > output_temp_${SLURM_ARRAYID}.out
sleep 10
来自文档
A maximum number of simultaneously running tasks from the job array
may be specified using a "%" separator. For example "--array=0-15%4"
will limit the number of simultaneously running tasks from this job
array to 4.
因此,如果您想提交一个包含 60 个职位的职位数组,但 运行 一次只能提交一个职位,像这样更新您的提交脚本应该可以解决问题
#SBATCH --array=1-60%1
我正在尝试在 SLURM 上提交一组作业,但睡眠命令没有按预期工作。我想每 10 秒启动一次工作。但是,此代码等待 10 秒以启动整个作业数组。我应该如何修改以下 bash 文件?
#!/usr/bin/env bash
# The name to show in queue lists for this job:
#SBATCH -J matlab.sh
# Number of desired cpus:
#SBATCH --cpus=1
#SBATCH --mem=8gb
# The time the job will be running:
#SBATCH --time=167:00:00
# To use GPUs you have to request them:
##SBATCH --gres=gpu:1
# If you need nodes with special features uncomment the desired constraint line:
##SBATCH --constraint=bigmem
#SBATCH --constraint=cal
##SBATCH --constraint=slim
# Set output and error files
#SBATCH --error=job.%J.err
#SBATCH --output=job.%J.out
# MAKE AN ARRAY JOB, SLURM_ARRAYID will take values from 1 to 100
#SARRAY --range=1-60
# To load some software (you can show the list with 'module avail'):
module load matlab
export from=400
export to=1000
export steps=60
mkdir temp_${SLURM_ARRAYID}
cd temp_${SLURM_ARRAYID}
# the program to execute with its parameters:
matlab < ../SS.m > output_temp_${SLURM_ARRAYID}.out
sleep 10
来自文档
A maximum number of simultaneously running tasks from the job array may be specified using a "%" separator. For example "--array=0-15%4" will limit the number of simultaneously running tasks from this job array to 4.
因此,如果您想提交一个包含 60 个职位的职位数组,但 运行 一次只能提交一个职位,像这样更新您的提交脚本应该可以解决问题
#SBATCH --array=1-60%1