reduction and task

Discuss the OpenMP 3.0 API Specifications with the OpenMP Arch. Review Board. (Read Only)

reduction and task

Postby fanbin » Fri Jan 16, 2009 9:06 pm

OpenMP Spec 3.0 [99:25-26] says "A list item that appears in a reduction clause of the innermost enclosing worksharing or parallel construct may not be accessed in an explicit task."

Does it mean that code like below is illegal?

Code: Select all
#pragma omp parallel sections reducton(+:k)
{
#pragma omp section
  {
    // blah blah
  }
#pragma omp section
  {
#pragma omp task shared(k)
    {
      k = ...
    }
#pragma omp taskwait
  }
}


Thanks!
-- Bin
fanbin
 
Posts: 15
Joined: Wed Jul 16, 2008 12:28 am

Re: reduction and task

Postby MarkB » Thu Feb 05, 2009 9:38 am

I think this code should be non-conforming. The section constructs are not a worksharing constructs: the parallel sections construct is the innermost worksharing or parallel construct in this case.
MarkB
 
Posts: 477
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh


Return to OpenMP 3.0 API Specifications

Who is online

Users browsing this forum: No registered users and 1 guest