title: Waiting for OpenMP task completion at implicit barriers?
body: <p>If I create a bunch of OpenMP tasks and do not use <code>taskwait</code>, where does the program wait for that tasks completion? Consider the following example:</p>
  
  <pre><code>#pragma omp parallel
  {
     #pragma omp single
     {
        for (int i = 0; i &lt; 1000; i++) {
           #pragma omp task
           ... // e.g., call some independent function
        }
        // no taskwait here
     }
     // all the tasks completed now?
  }
  </code></pre>
  
  <p>Does the program wait for task completion at the implicit barrier at the end of the <code>single</code> block? I assume so, but cannot find any information about this issue in the OpenMP Specification.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>From <code>barrier</code> description in OpenMP Spec.:</p>
  
  <blockquote>
    <p>All threads of the team executing the binding parallel region must
    execute the barrier region and complete execution of all explicit
    tasks bound to this parallel region before any are allowed to continue
    execution beyond the barrier.</p>
  </blockquote>
  
  <p>This, however, does not says whether I am responsible for task completion or the OpenMP runtime does it for me.</p>