title: How does OpenMP handle nested loops?
body: <p>Does the following code just parallelize the first (outer) loops, or it parallelize the entire nested loops?</p>
  
  <pre><code>    #pragma omp parallel for
      for (int i=0;i&lt;N;i++)
      { 
        for (int j=0;j&lt;M;j++)
        {
         //do task(i,j)//
        }
      }
  </code></pre>
  
  <p>I just want to make sure if the above code will parallelize the entire nested for-loops (thus one thread directly related task(i,j)), or it only parallelizes the outer for-loop (thus it ensures that, for each parrallel thread with loop index i, its inner loop will be done sequentially in a single thread, which is very import). </p>