GCC 4.9.1 OpenMP 4.0 task nesting

Raúl Vidal raulvior.bcn@gmail.com
Thu Apr 30 12:39:00 GMT 2015


Hi,
I'm using GCC 4.9.1 and its OpenMP 4.0 implementation.

I have a code like follows:

#pragma omp parallel
{
#pragma omp single
{

     for (i = 0; i < 10000; i++)
     {
              int x = 0;
              #pragma omp task depend(in:x) //task1
              {
                    for (int i = 0; i<4; i++){
                            #pragma omp task shared(x)
                            {
                                  dosomething(x); //tasknested
                            }
                    }
              }
              #pragma omp task depend(inout:x) //task2
              {
                       dosomething(x);
              }
             #pragma omp taskwait
      }
}
}



The problem I'm having is that "tasknested" is never being executed by
the thread which creates task1 (the parent of tasknested) and task2.

Is there a problem with task nesting without the nested task being
inside a function called by the parent task or something?

Thanks in advance.



More information about the Gcc-help mailing list