title: OpenMP parallelization of non-for loop
body: <p>So far I have only used OpenMP to parallelize for loop in C++. However I wonder if I can execute other lines of codes which are not for loops in Parallel. </p>
  
  <pre><code>void minimization(int *a, int *x) {
   // this part of the code is dependent of other library.
  }
  
  void checkForNaN(int *a){
   // check nan points
  }
  
  int main() {
    // read data
    minimization (a,b);
    checkForNaN(x);
  }
  </code></pre>
  
  <p>Consider the sample snippet above, whereby <code>minimization(,)</code> and <code>checkForNaN()</code> are independent that is results of either one does not affect the other once. Is it possible to parallelize it?</p>
  
  <p>I am thinking something like this:</p>
  
  <pre><code>  int main() {
        // read data
  #pragma omp parallel
      {
        minimization (a,b);
        checkForNaN(x);
       }
  }
  </code></pre>
  
  <p>Does it looks correct?</p>