irritable_phd_syndrome
irritable_phd_syndrome

Reputation: 5067

difference between slurm sbatch -n and -c

The cluster that I work with recently switched from SGE to SLURM. I was wondering what the difference between sbatch options --ntasks and --cpus-per-task?

--ntasks seemed appropriate for some MPI jobs that I ran but did not seem appropriate for some OpenMP jobs that I ran.

For the OpenMP jobs in my SLURM script, I specified:

#SBATCH --ntasks=20

All the nodes in the partition are 20core machines, so only 1 job should run per machine. However, multiple jobs were running simultaneously on each node.

Upvotes: 3

Views: 1087

Answers (1)

Zulan
Zulan

Reputation: 22670

Tasks in SLURM are basically processes / mpi ranks - it seems you just want a single task. A task can be multithreaded. The of cpus per taks is set via -c, --cpus-per-task. If you use hyperthreading it becomes a little bit more complicated, as explains in man srun.

Upvotes: 4

Related Questions