title: OpenMP Thread count question
body: <p>So Im doing a bit of Parallel Programming of the Trapezoidal Rule for my OS class, this is a homework question but im not looking for source code.</p>
  
  <p>after a bit of research I decided to use each thread to compute a subinterval.
  using:</p>
  
  <pre><code> g = (b-a)/n;
     integral += (func(a) + func(b))/2.0;
  
  #  pragma omp parallel for schedule(static) default(none) \
        shared(a, h, n) private(i, x) \
        reduction(+: integral) num_threads(thread_count)
     for (i = 1; i &lt;= n-1; i++) {
        x = a + i*g;
        integral += func(x);
     }
  </code></pre>
  
  <p>in my integral function, func(x) is the function that I read in from the file.</p>
  
  <p>So I email my professor to ask how he wants to go about choosing the number of threads. (since they will need to be evenly divisible by N (for the trapezoidal rule)</p>
  
  <p>but he is saying I dont need to define them, and it will define them based on the number of cores on my machine........So needless to say Im a bit confused.</p>