I am using a C program, compiled with gcc 4.9.2 on Windows7, using OpenMP 4.0. My computer is dual core, with four threads. I'd like to use thread affinity spread and use 2 threads put on different cores. So when I set the environment variables from DOS with:
- set OMP_NUM_THREADS=2
- set OMP_PROC_BIND=spread
- set OMP_PLACES="cores"
I get, with the variable OMP_DISPLAY_ENV=true, this:
libgomp: Invalid value for environment variable OMP_PLACES
OPENMP DISPLAY ENVIRONMENT BEGIN
_OPENMP = '201307'
OMP_DYNAMIC = 'FALSE'
OMP_NESTED = 'FALSE'
OMP_NUM_THREADS = '2'
OMP_SCHEDULE = 'DYNAMIC'
OMP_PROC_BIND = 'SPREAD'
OMP_PLACES = ''
OMP_STACKSIZE = '12872703'
OMP_WAIT_POLICY = 'PASSIVE'
OMP_THREAD_LIMIT = '4294967295'
OMP_MAX_ACTIVE_LEVELS = '2147483647'
OMP_CANCELLATION = 'FALSE'
OMP_DEFAULT_DEVICE = '0'
OPENMP DISPLAY ENVIRONMENT END
It seems that the input is not valid, so I changed it to:
- set OMP_PLACES="cores"
libgomp: Affinity not supported on this configuration
OPENMP DISPLAY ENVIRONMENT BEGIN
_OPENMP = '201307'
OMP_DYNAMIC = 'FALSE'
OMP_NESTED = 'FALSE'
OMP_NUM_THREADS = '2'
OMP_SCHEDULE = 'DYNAMIC'
OMP_PROC_BIND = 'SPREAD'
OMP_PLACES = ''
OMP_STACKSIZE = '3107827'
OMP_WAIT_POLICY = 'PASSIVE'
OMP_THREAD_LIMIT = '4294967295'
OMP_MAX_ACTIVE_LEVELS = '2147483647'
OMP_CANCELLATION = 'FALSE'
OMP_DEFAULT_DEVICE = '0'
OPENMP DISPLAY ENVIRONMENT END
And this is the result: affinity not supported. I get the same result even with:
set OMP_PLACES="{0},{2},{1},{3}"
Does any of you know how to solve this?