title: OpenMP recursive tasks
body: <p>Consider following Program calculating Fibonacci Numbers.<br>
  It uses OpenMP Tasks for parallelisation.</p>
  
  <pre><code>#include &lt;iostream&gt; 
  #include &lt;omp.h&gt;
  
  using namespace std;
  
  int fib(int n)
  {
      if(n == 0 || n == 1)
          return n;
  
      int res, a, b;
      #pragma omp parallel
      {
          #pragma omp single 
          {
              #pragma omp task shared(a)
              a = fib(n-1);
              #pragma omp task shared(b)
              b = fib(n-2);
              #pragma omp taskwait
              res = a+b;
          } 
  
      }
      return res;
    }
  
  int main()
  {  
      cout &lt;&lt; fib(40);    
  }
  </code></pre>
  
  <p>I use gcc version 4.8.2 and Fedora 20.<br>
  When compiling the above program with g++ -fopenmp name_of_program.cpp -Wall
  and running it, I see when looking into htop that only two (sometimes 3) threads are running.
  The machine I'm running this program on has 8 logical CPUs.
  My question is, what do I need to do to offload the work onto 8 Threads.
  I tried export OMP_NESTED=TRUE, but this leads to following error while running the 
  Program:<br>
  libgomp: Thread creation failed: Resource temporarily unavailable<br>
  The point of my program is not to efficiently compute Fibonacci Numbers, but to 
  use tasks or something similar in OpenMP.</p>