0

I am trying to understand how to correctly write SLURM scripts to maximize parallelism.

For example, let's propose the following escenario: I have a program written in OpenMPI and OpenMP has the following characteristics:

  • The program has 6 MPI processes
  • Each process uses 4 threads

The program has to run in a cluster that has 6 nodes; each node has 2 CPUs and each CPU has 8 cores.

What values should be set in my SLURM script so that the program is executed using the adequate number of resources AND the maximum number of instances of the program can be executed simultaneously?

By looking at the internet, I have found that there are many options such as:

  • --ntasks
  • --nodes
  • --tasks-per-node
  • --cpus-per-task
  • --ntasks-per-core
  • --ntasks-per-node
  • --ntasks-per-socket
  • --threads-per-core
  • --cores-per-socket
  • --sockets-per-node

I would say:

-- ntasks → 6                             # Number of MPI processes
-- nodes→ 6                               # Number of nodes
-- tasks-per-node → 1                     # Number of MPI processes per node
-- cpus-per-task → 4                      # Number of threads per MPI process

But I am not sure since I have no experience.

Any help will be appreciated! :)

1 Answer 1

3

Assuming an homogeneous cluster and an optimal network setting, the two most important parameters are

  • ntasks=6 the number of MPI processes
  • cpus-per-task=4 the number of threads per process

This is sufficient for Slurm to correctly allocate resources for your job, and by not specifying more constraints, you are letting Slurm optimise the resource usage the best it can and make the job throughput as high as possible.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.