【发布时间】:2021-11-30 09:40:30
【问题描述】:
我想通过提交一个独特的作业,使用 SLURM 对作业数组执行类似的(并行)运行。当一个任务完成后,我想开始第二次运行,输入第一个任务生成的文件。可能吗?我举个例子。
我想使用$SLURM_ARRAY_TASK_ID=0,1,2 运行 3 个并行任务。
当单个任务完成时,例如srun ./my_program1.exe 0 已完成,我想启动 srun ./my_program2.exe 0 < input_from_myprogram1_taskid=0,即使 srun ./my_program1.exe 1 仍在运行(每个任务的执行时间可能略有不同)。安全吗,有意义吗?
#!/bin/bash
#
#SBATCH --job-name=test_emb_arr
#SBATCH --output=res_emb_arr.txt
#
#SBATCH --ntasks=1
#SBATCH --time=10:00
#SBATCH --mem-per-cpu=100
#
#SBATCH --array=0-2
srun ./my_program1.exe $SLURM_ARRAY_TASK_ID
###something that tells to the machine to wait until srun ./my_program1.exe $SLURM_ARRAY_TASK_ID is finished before make the following second run
srun ./my_program2.exe $SLURM_ARRAY_TASK_ID < input_from_previous_single_run
【问题讨论】:
标签: arrays jobs slurm parallels sbatch