The Path from Multicore to Manycore: Listing 1.

Serial implementation of Fibonacci code.

int fib (int n) {
  if (n <= 2)
    return n;
  else {
    int x,y;
    x = fib(n-1);
    y = fib(n-2);
    return x+y;
  }
}