1

Hi I'm running linux on a system where each node has 64 cores with 4 processors of 16 cores each, I'm trying to run a C++ program on one specific processor (on 16 cores), when I set OMP_NUM_THREADS to 16 and run my program the results viewed in HTOP show the work is distributed across the 4 processors, how can I set OpenMP to run on only one processor

pyCthon
  • 11,746
  • 20
  • 73
  • 135

1 Answers1

1

I think the answer to this question covers it pretty well. The answer is that there's no language-level construct in OpenMP for setting processors; OpenMP only recently (3.1) has a mechanism for even ensuring that a thread will stay on a given processor once its launched (this is called "processor affinity").

However, most OpenMP implementations go beyond the standard to allow you to bind a thread to a particular core or socket. In addition, your environment may have launching mechanisms (eg, numactl for linux) which allow you to set the binding at launch time.

Community
  • 1
  • 1
Jonathan Dursi
  • 50,107
  • 9
  • 127
  • 158