2 Replies Latest reply: Aug 9, 2011 2:22 AM by 880893 RSS

    OpenMP compiler warnings

    880893
      Hi,

      according to the C++ compiler manual, -xvpara issues a warning when a loop is parallelized using MP directives with data dependencies between different loop iterations. However, when I compile the program given below using "CC -xopenmp -xvpara fib.cpp" no warning is emitted even though there are dependencies between the loop iterations. I'm using CC 5.11 from Solaris Studio 12.2. Any ideas what's going wrong?

      Thanks a lot
      Karl



      #include <omp.h>
      #define SIZE 10

      int main() {
      int fib[SIZE];
      fib[0] = 0;
      fib[1] = 1;
      #pragma omp parallel for shared(fib)
      for(int i = 2; i < SIZE; i++)
      fib[i] = fib[i-1] + fib[i-2];
      }