Software Archive
Read-only legacy content
17061 Discussions

OpenMP - Fine vs Thread vs Core

CPati2
New Contributor III
422 Views

Hi All,

KMP_AFFINITY can be used to set thread granularity of fine, thread, and core. Can someone please give me an example how these differ? I understand that thread granularity for threads sharing same core is mostly time based, but an explanation here will help confirm it.

I am using Xeon Phi 7210.

Thanks.

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
422 Views

See: https://software.intel.com/en-us/node/522691

fine and thread are functionally equivalent.

You might consider experimenting with float_list syntax to setup 2, 3 or 4 threads per core whereby those threads are permitted to run on any of the hardware threads of that core.

Jim Dempsey

 

View solution in original post

0 Kudos
2 Replies
jimdempseyatthecove
Honored Contributor III
423 Views

See: https://software.intel.com/en-us/node/522691

fine and thread are functionally equivalent.

You might consider experimenting with float_list syntax to setup 2, 3 or 4 threads per core whereby those threads are permitted to run on any of the hardware threads of that core.

Jim Dempsey

 

0 Kudos
James_C_Intel2
Employee
422 Views

Jim is (as usual) right. "fine" and "thread" mean the same thing here.

You may already understand this, but just in case... It is critical to understand that this aspect of the affinity is not specifying where a thread is placed, but how tightly it is bound to that place. i.e. what freedom is left to the operating system to migrate the thread and run it on some other hardware thread. With "fine/thread" granularity the thread can only be run on the precise hardware thread (logicalCPU) specified, whereas with "core" it can be run on any of the hardware threads that are in the same core. Realistically, this should make very little difference, since the hardware threads in a core share all levels of cache, so migrating a thread between them shouldn't have much cost.

You can, of course, see the effect of the different policies by adding ",verbose"  to the affinity, then the runtime will show you exactly which logicalCPUs each thread is allowed to run on.

0 Kudos
Reply