Set thread affinity on two cores using OpenMP
问题 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