OpenMP and CPU affinity
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Will sched_setaffinity or pthread_attr_setaffinity_np work to set thread affinity under OpenMP? Related: CPU Affinity 回答1: Yes, named calls will work to set thread affinity. The only problem is to fix thread number and to set right affinity in right thread (you can try using static scheduling of for loop for known number of threads). As I know, almost every openmp allows to set affinity via environment. The name of environment variable varies (it was not standartized some time ago). I use http://www.spec.org/omp2001/results/omp2001.html page