Lous
Lous

Reputation: 45

OpenMP and OpenMPI using SLURM

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 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:

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! :)

Upvotes: 0

Views: 870

Answers (1)

damienfrancois
damienfrancois

Reputation: 59110

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.

Upvotes: 2

Related Questions