title: Number of threads within an OMP section
body: <p>My computer has four cores. I'm running Ubuntu 15.10, and compiling using g++ -fopenmp ...</p>
  
  <p>I have two different types of jobs, and both are mutually independent: Work1 and Work2. In particular, Work1 should run on a single processor, but Work2 should be parallelized. I tried using omp_set_num_threads():</p>
  
  <pre><code>#pragma omp parallel sections
  {
      #pragma omp section
      {
          // Should run on one processor.
          omp_set_num_threads(1);
          Work1();
      }
  
      #pragma omp section
      {
          // Should run on as many processors as possible.
          omp_set_num_threads(3);
          Work2();
      }
  }
  </code></pre>
  
  <p>Say Work2 is something like this:</p>
  
  <pre><code>void Work2(...){
      #pragma omp parallel for
      for (...) ...
  
      return;
  }
  </code></pre>
  
  <p>When the program is run, only two processors are used. Obviously omp_set_num_threads() is not working as I expected. Is there anything that can be done using OpenMP to remedy this situation?</p>
  
  <p>Thanks to all,</p>
  
  <p>Rodrigo</p>