术语 "job"、"task" 和 "step" 之间有什么关系?

How do the terms "job", "task", and "step" relate to each other?

SLURM 文档中使用的术语 "job"、"task" 和 "step" 如何相互关联?

A​​FAICT,一项工作可能包含多个任务,也可能包含多个步骤,但是,假设这是真的,我仍然不清楚任务和步骤之间的关系。

查看显示 jobs/tasks/steps 的完整复杂性的示例会很有帮助。

一项工作包含一个或多个步骤,每个步骤包含一个或多个任务 每个使用一个或多个 CPU.

通常使用 sbatch 命令创建作业,使用 srun 命令创建步骤,请求任务,在作业级别使用 --ntasks--ntasks-per-node ,或在 --ntasks 的步骤级别。 CPU 每个任务 请求 --cpus-per-task。请注意,使用 sbatch 提交的作业有一个隐式步骤; Bash 脚本本身。

承担假设工作:

#SBATCH --nodes 8
#SBATCH --tasks-per-node 8
# The job requests 64 CPUs, on 8 nodes.    

# First step, with a sub-allocation of 8 tasks (one per node) to create a tmp dir. 
# No need for more than one task per node, but it has to run on every node
srun --nodes 8 --ntasks 8 mkdir -p /tmp/$USER/$SLURM_JOBID

# Second step with the full allocation (64 tasks) to run an MPI 
# program on some data to produce some output.
srun process.mpi <input.dat >output.txt

# Third step with a sub allocation of 48 tasks (because for instance 
# that program does not scale as well) to post-process the output and 
# extract meaningful information
srun --ntasks 48 --nodes 6 --exclusive postprocess.mpi <output.txt >result.txt &

# Four step with a sub-allocation on a single node   
# to compress the raw output. This step runs at the same time as 
# the previous one thanks to the ampersand `&` 
srun --ntasks 12 --nodes 1 --exclusive compress.mpi output.txt &

wait

创建了四个步骤,因此该作业的会计信息将有 5 行;每一步加一个 Bash 脚本本身。