HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

11.6  distribute Construct

Name: distribute

Association: loop

Category: executable

Properties: work-distribution

Clauses

allocate, collapse, dist_schedule, firstprivate, lastprivate, order, private

Binding

The binding thread set for a distribute region is the set of initial threads executing an enclosing teams region. A distribute region binds to this teams region.

Semantics

The distribute construct specifies that the iterations of one or more loops will be executed by the initial teams in the context of their implicit tasks. The iterations are distributed across the initial threads of all initial teams that execute the teams region to which the distribute region binds. No implicit barrier occurs at the end of a distribute region. To avoid data races the original list items that are modified due to lastprivate clauses should not be accessed between the end of the distribute construct and the end of the teams region to which the distribute binds.

If the dist_schedule clause is not specified, the schedule is implementation defined.

At the beginning of each logical iteration, the loop iteration variable or the variable declared by range-decl of each associated loop has the value that it would have if the set of the associated loops was executed sequentially.

The schedule is reproducible if one of the following conditions is true:

Programs can only depend on which team executes a particular iteration if the schedule is reproducible. Schedule reproducibility also determines the consistency with the execution of constructs with the same schedule.

Execution Model Events

The distribute-begin event occurs after an initial task encounters a distribute construct but before the task starts to execute the structured block of the distribute region.

The distribute-end event occurs after an initial task finishes execution of a distribute region but before it resumes execution of the enclosing context.

The distribute-chunk-begin event occurs for each scheduled chunk of a distribute region before execution of any associated iteration.

Tool Callbacks

A thread dispatches a registered ompt_callback_work callback with ompt_scope_begin as its endpoint argument and ompt_work_distribute as its work_type argument for each occurrence of a distribute-begin event in that thread. Similarly, a thread dispatches a registered ompt_callback_work callback with ompt_scope_end as its endpoint argument and ompt_work_distribute as its work_type argument for each occurrence of a distribute-end event in that thread. The callbacks occur in the context of the implicit task. The callbacks have type signature ompt_callback_work_t.

A thread dispatches a registered ompt_callback_dispatch callback for each occurrence of a distribute-chunk-begin event in that thread. The callback occurs in the context of the initial task. The callback has type signature ompt_callback_dispatch_t.

Restrictions

Restrictions to the distribute construct are as follows:

Cross References