title: How does the SECTIONS directive in OpenMP distribute work?
body: <p>In OpenMP when using <code>omp sections</code>, will the threads be distributed to the blocks inside the <em>sections</em>, or will each thread be assigned to each sections?</p>
  
  <p>When <code>nthreads == 3</code>:</p>
  
  <pre><code>#pragma omp sections
  {
      #pragma omp section
      { 
          printf ("id = %d, \n", omp_get_thread_num());
      }
  
      #pragma omp section
      { 
          printf ("id = %d, \n", omp_get_thread_num());
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>id=1
  id=1
  </code></pre>
  
  <p>But when I execute the following code:</p>
  
  <pre><code>#pragma omp sections
  {
      #pragma omp section
      { 
          printf ("id = %d, \n", omp_get_thread_num());
      }
  
      #pragma omp section
      { 
          printf ("id = %d, \n", omp_get_thread_num());
      }
  }
  
  #pragma omp sections
  {
      #pragma omp section
      { 
          printf ("id = %d, \n", omp_get_thread_num());
      }
  
      #pragma omp section
      { 
          printf ("id = %d, \n", omp_get_thread_num());
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>id=1
  id=1
  
  id=2
  id=2
  </code></pre>
  
  <p>From these output I can't understand what the concept of sections is in OpenMP.</p>