title: How to design a parallel code for a Fibonacci algorithm, but without openmp tasks?
body: <p>I want to write a c++ code for calculating Fibonacci numbers in parallel, with a use of OpenMP tools. I know that, with <code>#pragma omp task</code>, the code will be:</p>
  
  <pre><code>int fib(int n) {
  int i, j;
  if (n&lt;2)
      return n;
  else {
      #pragma omp task shared(i)
      i=fib(n-1);
      #pragma omp task shared(j)
      j=fib(n-2);
      #pragma omp taskwait
      return i+j;
      }
  }
  </code></pre>
  
  <p>Computing this way is not cool, since each thread is waiting for its child threads to complete their work, so the whole process is still a sequential!  </p>
  
  <p>I want to write the parallel code, using this equation:</p>
  
  <p>F(n + k) = F(n + 1) * F(k) + F(n) * F(k - 1)</p>
  
  <p>Would anyone help me to do this?</p>