Setting thread Affinity to Single Core

Setting thread Affinity to Single Core


I couldn't understand from the doc how to limit my omp program to a single Core.

Basically I'm checking a program with 1 or 2 threads, and I want both threads to run on the same Core to see the advantages or hyperthreading.

There should be a simple KMP_AFFINITY to set, but I couldn't understand which.



Thread Topic: 

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


Is there a way to set the affinity to a specific core? As in if I want the program to run entirely on Core 0?


You are asking your question on the wrong forum, as this one is dedicated to discussions on the Open Source run-time library.  General questions on the compiler behavior should be asked on the corresponding compiler forum.

I'll try to write some details on the question in personal e-mail.


Leave a Comment

Please sign in to add a comment. Not a member? Join today