1 year ago

#360940

test-img

vsmith

How to control processes and threads in hybrid OpenMP/MPI job

I'm trying to control the distribution of MPI processes and their threads. In a 4-core system (cores 0, 1, 2 and 3) with GNU compilers and OpenMPI, submitting a 2x2 job (export OMP_NUM_THREADS=2 && mpirun -np 2 --report-bindings exec) will assign the 2 MPI processes to 0 and 1 [I'm unsure how the threads are spread on the other cores -as this info is not reported- so my assumption is that they are pinned to cores 2 & 3 respectively].

The problems start when I try to force the MPI processes into running on cores 0 and 2. I have tried several combinations. The first one (export OMP_NUM_THREADS=2 && export OMP_PLACES=cores && export OMP_PROC_BIND=close && mpirun -np 2 --report-bindings exec) results in the same distribution. The second submits the job as (export OMP_NUM_THREADS=2 && export OMP_PLACES="{0,2}" && export OMP_PROC_BIND=close && mpirun -np 2 --report-bindings exec) but this leads to the error message:

libgomp: None of the places contain usable logical CPUs

libgomp: Invalid value for environment variable OMP_PLACES

I wasn't expecting this error and was wondering why this is happening. Thanks.

openmp

gnu

openmpi

0 Answers

Your Answer

Accepted video resources