How to make OpenMP thread or task run on a certain core
问题 Is there a way to make an OMP thread or task run on a certain core? I found this, followed the link, but I couldn't find the source code to test it. Also this is an Intel solution to it (I think). Does OMP support this itself? 回答1: As far as I know as of OpemMP 3.0 they're all vendor specific extensions. For example GOMP (GCC's implementation) honours the environment variable GOMP_CPU_AFFINITY for setting thread affinity. In their documentation they give the example: GOMP_CPU_AFFINITY="0 3 1