-par-affinity option doesn't work

-par-affinity option doesn't work

Hi,

Compiling this code:

#include 
using namespace std;

#include 

int main(int argc, char *argv[]){
int nproc = omp_get_num_procs();
cout<}

with:

icpc -openmp -par-affinity=verbose,scatter test.c

then running a.out yields a single line of output ("2", this is a single CPU, dual-core). So the "verbose" modifier isn't taken into account. On the contrary, compiling with:

icpc -openmp test.c 

and setting environment variable KMP_AFFINITY to "verbose,scatter" yields the expected verbose output:

OMP: Info #204: KMP_AFFINITY: decoding cpuid leaf 11 APIC ids.
OMP: Info #205: KMP_AFFINITY: cpuid leaf 11 not supported - decoding cpuid leaf 4 APIC ids.
OMP: Info #149: KMP_AFFINITY: Affinity capable, using global cpuid info
OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: {0,1}
OMP: Info #156: KMP_AFFINITY: 2 available OS procs
OMP: Info #157: KMP_AFFINITY: Uniform topology
OMP: Info #159: KMP_AFFINITY: 1 packages x 2 cores/pkg x 1 threads/core (2 total cores)
OMP: Info #206: KMP_AFFINITY: OS proc to physical thread map:
OMP: Info #171: KMP_AFFINITY: OS proc 0 maps to package 0 core 0 
OMP: Info #171: KMP_AFFINITY: OS proc 1 maps to package 0 core 1 
OMP: Info #147: KMP_AFFINITY: Internal thread 0 bound to OS proc set {0}
2

icpc version 12.0.0

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I think I recall seeing -par-affinity="verbose,scatter=1" work. I haven't used it much, as it would be better for multiple platform as well as experimental usage to be able to over-ride by setting KMP_AFFINITY, and recent versions of the library seem not so dependent on KMP_AFFINITY (in the easy cases).

Login to leave a comment.