MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / fib_omp

Function fib_omp

check/TestHighsParallel.cpp:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42#if 0
43int64_t fib_omp(const int64_t n) {
44 if (n <= 20) return fib_sequential(n);
45
46 int64_t n1;
47#pragma omp task shared(n1)
48 n1 = fib_omp(n - 1);
49
50 int64_t n2 = fib_omp(n - 2);
51
52#pragma omp taskwait
53
54 // printf("fib(%ld) = %ld + %ld = %ld\n", n, n1, n2, n1 + n2);
55 return n1 + n2;
56}
57
58// matrix_multiplication_omp
59// reference: https://computing.llnl.gov/tutorials/openMP/samples/C/omp_mm.c

Callers 1

Calls 1

fib_sequentialFunction · 0.85

Tested by

no test coverage detected