Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Why only half of the cores are used in OPENMP

志强_赵_
Beginner
1,852 Views

I have 20 cores per node. I run codes on the machine  using OPENMP.

Why only half of the number of the cores(10) are used, while the others are sleeping?

It puzzles me a lot. 

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
1,852 Views

Check your OpenMP environment variables relating to affinity. This would be KMP_AFFINITY, GOMP_CPU_AFFINITY, OMP_PLACES, OMP_PROC_BIND, KMP_PLACE_THREADS. And the non-affinity related settings: OMP_THREAD_LIMIT, KMP_ALL_THREADS.

The system administrator may also be able to restrict the number of (and which) logical processors are available to a process (e.g. taskset, cpuset, ...).

Jim Dempsey

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,852 Views

Are you sure you have 20 cores per node as opposed to 10 cores/20 logical processors per node? (Hyperthreading provides for 2 hardware threads per core). As to why this is important, the OpenMP environment variables can be set to limit the OpenMP thread pool to 1 thread per core (each thread can float between either of the 2 hardware threads of a core, no two thread sharing the same core).

Jim Dempsey

0 Kudos
志强_赵_
Beginner
1,852 Views

The cpuinfo is attached. My program only use the 10 cores with physical id=0.

jimdempseyatthecove wrote:

Are you sure you have 20 cores per node as opposed to 10 cores/20 logical processors per node? (Hyperthreading provides for 2 hardware threads per core). As to why this is important, the OpenMP environment variables can be set to limit the OpenMP thread pool to 1 thread per core (each thread can float between either of the 2 hardware threads of a core, no two thread sharing the same core).

Jim Dempsey

0 Kudos
Reply