1
votes

I am trying to understand why twice the amount of cores I request are being allocated to my sbatch jobs. From what I can tell, my partition has 106 threads:

    [.... snake_make]$ sinfo -p mypartition -o %z
S:C:T
2:26:2

Yet with the sbatch set like so for my snakemake:

module load snakemake/5.6.0 snakemake -s snake_make_tetragonula --cluster-config cluster.yaml --jobs 70
--cluster "sbatch -n 4 -M {cluster.cluster} -A {cluster.account} -p {cluster.partition}"
--latency-wait 10

Each job is being allocated 8 cores instead of 4. When I run squeue, I see that it is only able to run as many as 12 jobs at a time, suggesting that it is using 8 cores for each job despite me specifying 4 threads. Also when I look at my job usage on XDMoD, I see that only half of the cpus on the job are getting used. How can I use exactly as many cpus as I want and not double that amount, like it is currently running? I have also tried

--ntasks=1 --cpus-per-task=4

which still doubled it to 8. Thanks.

1

1 Answers

1
votes

Slurm can only allocate cores, not threads. So, with such a configuration:

S:C:T
2:26:2

two threads are allocated to jobs for each core being requested. Two hardware threads cannot be allocated to distinct jobs.

You can try with

--ntasks=1 --cpus-per-task=2 --threads-per-core=2

But, if your computation is CPU-intensive, this can make your jobs slower.