Multithreaded Jobs

Many modern software like Matlab, NumPy, etc. come with libraries that are able to use multiple CPU-cores via shared-memory parallel programming techniques like OpenMP or pthreads.

For such applications, one can use the cpus-per-task parameter to tell Slurm to run the job using multiple CPU-cores.

Note that the product of ntasks and cpus-per-task should not be greater than the number of CPU-cores allowed on a partition/QoS.

Using larger values of cpus-per-task will not magically speed up your job. This leads to wastage of resources and might even cause your job to be assigned a lower priority. So, make sure your application uses multithreading libraries or your code has been explicitly written to use multiple threads.

We provide examples for multithreaded:

  • MATLAB
  • OpenMP
  • Python