I was using SLURM to use some computing cluster and it had the -ntasks
or -n
. I have obviously read the documentation for it (http://slurm.schedmd.com/sbatch.html):
sbatch does not launch tasks, it requests an allocation of resources and submits a batch script. This option advises the Slurm controller that job steps run within the allocation will launch a maximum of number tasks and to provide for sufficient resources. The default is one task per node, but note that the --cpus-per-task option will change this default.
the specific part I do not understand what it means is:
run within the allocation will launch a maximum of number tasks and to provide for sufficient resources.
I have a few questions:
- I guess my first question is what does the word "task" mean and the difference is with the word "job" in the SLURM context. I usually think of a job as the running the bash script under sbatch as in
sbatch my_batch_job.sh
. Not sure what task means. - If I equate the word task with job then I thought it would have ran the same identical bash script multiple times according to the argument to
-n, --ntasks=<number>
. However, I obviously tested it out in the cluster, ran aecho hello
with--ntask=9
and I expected sbatch would echo hello 9 times to stdout (which is collected inslurm-job_id.out
, but to my surprise, there was a single execution of my echo hello script Then what does this command even do? It seems it does nothing or at least I can't see whats suppose to be doing.
I do know the -a, --array=<indexes>
option exists for multiple jobs. That is a different topic. I simply want to know what --ntasks
is suppose to do, ideally with an example so that I can test it out in the cluster.