title: openmp randomly uses only one core
body: <p>I'm on Ubuntu <code>10.04</code>, gcc version <code>4.4.3</code>. I'm compiling c++ code with <code>omp.h</code> and a g++ parameter <code>-fopenmp</code>. Most of the time everything works as expected. I have quad-core with hyper-threading, so virtually 8 cores.</p>
  
  <p>Randomly, when I run my software (and watch system monitor) all 8 cores woof up to 100%, fans kick in, all that good deal. Within half a second all cores but 1 shut down to inactive, and one remains working.</p>
  
  <p>At this time if I cancel my program (just plain Ctrl+C) and restart it - it works as expected, all cores keep working at 100%.</p>
  
  <p>Here are snippets of code in case it's useful:</p>
  
  <pre><code>28 #include &lt;time.h&gt;
  29 #include &lt;omp.h&gt;
  30 #include &lt;string&gt;
  ...
  713 #ifdef _OPENMP
  714         if(omp_get_dynamic())
  715                 omp_set_dynamic(1);
  716 #endif
  717 
  718 #pragma omp parallel
  719         {
  720 #pragma omp for schedule(dynamic) private(node)
  721                 for (int c = 0; c &lt; buffer-&gt;GetCount(); c++) {
  ... initialize objects pointers etc
  724 #pragma omp critical(BUFFER_LOOKUP)
  725                         {
  ... perform chunk of code that is a choke
  734                         }
  </code></pre>