title: OpenMP GCC GOMP wasteful barrier
body: <p>I have the following program.
  nv is around 100, dgemm is 20x100 or so, so there is plenty of work to go around:</p>
  
  <pre><code>#pragma omp parallel for schedule(dynamic,1)
          for (int c = 0; c &lt; int(nv); ++c) {
              omp::thread thread;                                               
              matrix &amp;t3_c = vv_.at(omp::num_threads()+thread);
              if (terms.first) {
                  blas::gemm(1, t2_, vvvo_, 1, t3_c);
                  blas::gemm(1, vvvo_, t2_, 1, t3_c);
              }
  
              matrix &amp;t3_b = vv_[thread];
              if (terms.second) {
                  matrix &amp;t2_ci = vo_[thread];
                  blas::gemm(-1, t2_ci, Vjk_, 1, t3_c);
                  blas::gemm(-1, t2_ci, Vkj_, 0, t3_b);
              }
          }
  </code></pre>
  
  <p>however with GCC 4.4, GOMP v1, the <code>gomp_barrier_wait_end</code> accounts for nearly 50% of runtime.  Changing <code>GOMP_SPINCOUNT</code> aleviates the overhead but then only 60% of cores are used.  Same for <code>OMP_WAIT_POLICY=passive</code>.  The system is Linux, 8 cores.</p>
  
  <p>How can i get full utilization without spinning/waiting overhread</p>