Implicit barriers and explicit tasks

The public comment period closed January 31, 2008. This forum is now locked (read only).

Implicit barriers and explicit tasks

Postby jakub » Mon May 19, 2008 8:39 am

For explicit barriers, 2.8.3 says:
"All threads of the team executing the binding parallel region must execute the barrier region and complete execution of all explicit tasks generated in the binding parallel region up to this point before any are allowed to continue execution beyond the barrier."
Furthermore, 1.3 says that completion of all explicit tasks bound to the current parallel region is guaranteed before the master thread leaves the implicit barrier at the end of the parallel region.
As 2.8.3 is written in the explicit barrier description, I wonder whether implicit barriers provide similar guarantee (then the 1.3 sentence would be even redundant). Say
Code: Select all
int e;
int main ()
{
  e = 0;
  #pragma omp parallel
  {
    #pragma omp for
    for (int i = 0; i < 4; i++)
      #pragma omp task shared (e)
        #pragma omp atomic
          e++;
    // Does the implicit barrier here guarantee all explicit tasks completed?
    if (e != 4)
      abort ();
  }
jakub
 
Posts: 74
Joined: Fri Oct 26, 2007 3:19 am

Return to Draft 3.0 Public Comment

Who is online

Users browsing this forum: No registered users and 0 guests