Oracle® Solaris Studio 12.4: OpenMP API User's Guide

Exit Print View

Updated: December 2014
 
 

4.5.1 Notes About Task Dependence

    Note the following tips about task dependence:

  • in, out, and inout dependence-types in the depend clause are similar to read and write operations, although the in, out and inout dependence-types are solely for establishing task dependences. They do not indicate any memory access patterns inside task regions. A task having a depend(in:a), depend(out:a), or depend(inout:a) clause may read or write variable a inside its region, or may even not access variable a at all.

  • Having both the if clause and the depend clause on the same task directive can be expensive when the condition of the if clause evaluates to false. When a task has an if(false) clause, the encountering thread must suspend the current task region until the generated task (the task with the if(false) clause) is completed. At the same time, the task scheduler should not schedule the generated task until its task dependences are fulfilled. Because the point immediately following the generation of an explicit task is a task scheduling point, the task scheduler will try to schedule tasks so that the task dependences of the undeferred task are fulfilled. Finding and scheduling the right tasks in the pool may be expensive. In the worst case, it can be as expensive as having a taskwait region.

  • List items used in depend clauses of the same task or sibling tasks must indicate identical storage or disjoint storage. Therefore, if array sections appear in depend clauses, make sure that the array sections indicate either identical or disjoint storage.