title: What are the considerations for CPU affinity?
body: <p>When should a user set <code>OMP_PROC_BIND</code> to <code>TRUE</code> in an OMP-parallelized application? It would seem that keeping the thread on the same CPU should be faster because you may be reducing some scheduling and maybe cache movement overhead.</p>
  
  <p>I am interested in the answer to this question in the context of multiple OMP-parallelized processes.</p>
  
  <p>Let's take a concrete example. I have a 48-core box and two similar applications with <code>OMP_NUM_THREADS=16</code>. Am I better off letting <code>OMP_PROC_BIND</code> be unset and let natural affinity take its course?</p>
  
  <p>Experimenting with <code>OMP_PROC_BIND=TRUE</code>, my <code>libgomp</code> system seems not to play nicely when there are multiple OMP processes: all 32 threads are scheduled on the same 16 cpus. Without <code>OMP_PROC_BIND</code> all 48 cores appear to be used at some point and everything runs faster.</p>
  
  <p>Then the question stands: to what end is CPU affinity?</p>