Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

KMP_Affinity

dstralau
Beginner
875 Views
Hi @all

under Win7Pro 64, AMD Athlon X4 645

i got an exception , first warning is :
OMP: Warinig #72: KMP_AFFINITY: affinitity only supportedfor Intel *...

second warnig is :

OMP: Warinig #71: KMP_AFFINITY: affinity is not supported, using "none"

and then the program crashes.

Any idear ?

Thx.

Ps: i used w_ccompxe_redist_ia32_2011.7.258.msm in the istall process
0 Kudos
7 Replies
Ron_Green
Moderator
875 Views
Correct, KMP_AFFINITY is only available for genuine intel architecture:

http://software.intel.com/en-us/articles/optimization-notice/
0 Kudos
TimP
Honored Contributor III
875 Views
Even if you choose a KMP_AFFINITY option which isn't supported on AMD, resulting in the choice of "none," this would affect the execution of your program only if you have a race condition which can be papered over by a different mapping of threads to cores.
As KMP_AFFINITY doesn't impose a strict mapping, it's possible for the mapping to vary occasionally. You could try KMP_AFFINITY by the numbers, e.g.
set KMP_AFFINITY="proclist=[0-3],explicit"
to see if that will be accepted, and you could add the verbose option to see if it comes out the same as "none."
"idear" was a common pronunciation among my schoolmates when I was young, but that was a long time ago.
Note that it's confusing when you ask about Windows on the linux forum. People might not notice this and may not give the best answers.
KMP_AFFINITY is likely to be less effective on Windows than on linux, but your CPU ought not to depend on it.
0 Kudos
pbkenned1
Employee
875 Views

Regarding OMP: Warning #72: & Warning #71:, there is a known issue with the 12.1.1 compiler when running an application compiled with -openmp on a host not containing a genuine Intel processor. As a workaround, set environment variable KMP_AFFINITY to 'none' or 'disabled'.

Patrick Kennedy

Intel Developer Support

0 Kudos
tfield98
Beginner
875 Views
Can Intel provide us with a simple high-level means to detect if we're on a genuine Intel processor on all Windows versions? Is there one registry variable we can check on all versions of Windows for an embedded "Intel" string or something?
Patrick, I hope management there are aware of this product defect in an Intel product.
0 Kudos
TimP
Honored Contributor III
875 Views
If I'm understanding the thread correctly, you are running a version where that known failure of KMP_AFFINITY=none has been corrected.
A high level way to see your CPU brand is "less /proc/cpuinfo"
If you add the ,verbose option to your KMP_AFFINITY string, you will see if your selection has been reset to "none" on account of not recognizing the CPU. In this case, your remedy is to employ taskset, using your superior knowledge of the platform architecture.
Permuting affinity should not break a correct program (as long as you don't overflow stack or memory by piling multiple threads per core), but it will detract from performance on a multiple CPU platform. It could happen on an Intel CPU newer than those for which your ifort was tested.
I'm sure that a lot of effort has been expended looking for ways for KMP_AFFINITY to work with the widest possible selection of CPUs. If it were easy, such a facility would even work on Windows with non-Intel software and hardware.
The open source tool hwloc should help with understanding of your platform topology and perhaps how to employ taskset with KMP_AFFINITY=none.
0 Kudos
SergeyKostrov
Valued Contributor II
875 Views
Quoting tfield98
Can Intel provide us with a simple high-level means to detect if we're on a genuine Intel processor on all Windows versions?

[SergeyK] There is a high-level API from Microsoftto do what you want and this is WMI.
In case of alow level APIyou can use a '__cpuid' intrinsic function.

Is there one registry variable we can check on all versions of Windows for an embedded "Intel" string or something?

[SergeyK] I don't know ifthis is applicable for ALL versions of Windows but you can look at a registry key:

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

Best regards,
Sergey
0 Kudos
JVanB
Valued Contributor II
874 Views
You can always execute the CPUID instruction with EAX = 0; the string 'GenuineIntel' will be contained in EBX:EDX:ECX for an Intel processor. Obviously you can do this with an ifort program with some difficulty.The difficulty level would be less if ifort provided an extension, but it's not that hard in any case given that you can just copy and paste the code from the web.
0 Kudos
Reply