[slurm-users] OpenMP job and not expected results

Gestió Servidors sysadmin.caos at uab.cat
Fri Jan 22 10:33:15 UTC 2021


Hello,

I'm running this script in a cluster composed by 11 nodes, each one with 1 processor with 4 cores and 1 thread per core:

#!/bin/bash

#SBATCH --job-name=hellohybrid
#SBATCH --output=hellohybrid.out
#SBATCH --ntasks=4
#SBATCH --cpus-per-task=3
#SBATCH --partition=nodes

# Load the default OpenMPI module.
source /soft/modules-3.2.10/Modules/3.2.10/init/bash
module load openmpi/3.0.0

# Set OMP_NUM_THREADS to the number of CPUs per task we asked for
export OMP_NUM_THREADS=$(($SLURM_CPUS_PER_TASK))

# Run the process with mpirun. Note that the -n option is not required
# in this case; mpirun will automatically determine how many processes
# to run from the Slurm settings.

mpirun hybrid_hello

However, output is this:
Hello from thread 0 out of 3 from process 0 out of 4 on node1
Hello from thread 2 out of 3 from process 0 out of 4 on node1
Hello from thread 0 out of 3 from process 1 out of 4 on node1
Hello from thread 1 out of 3 from process 1 out of 4 on node1
Hello from thread 0 out of 3 from process 2 out of 4 on node1
Hello from thread 1 out of 3 from process 2 out of 4 on node1
Hello from thread 2 out of 3 from process 1 out of 4 on node1
Hello from thread 0 out of 3 from process 3 out of 4 on node2
Hello from thread 2 out of 3 from process 3 out of 4 on node2
Hello from thread 1 out of 3 from process 3 out of 4 on node2
Hello from thread 1 out of 3 from process 0 out of 4 on node1
Hello from thread 2 out of 3 from process 2 out of 4 on node1

As you could see, ode1 has run 9 threads, but my computer can only assign 8... can't it? Or am I wrong????

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20210122/c06d13bd/attachment.htm>


More information about the slurm-users mailing list