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

11.3  sections Construct

Name: sections

Association: block

Category: executable

Properties: work-distribution, worksharing, thread-limiting, cancellable

Separating directives

section

Clauses

allocate, firstprivate, lastprivate, nowait, private, reduction

Binding

The binding thread set for a sections region is the current team. A sections region binds to the innermost enclosing parallel region. Only the threads of the team that executes the binding parallel region participate in the execution of the structured block sequences and the implied barrier of the sections region if the barrier is not eliminated by a nowait clause.

Semantics

The sections construct is a non-iterative worksharing construct that contains a structured block that consists of a set of structured block sequences that are to be distributed among and executed by the threads in a team. Each structured block sequence is executed by one of the threads in the team in the context of its implicit task. An implicit barrier occurs at the end of a sections region if the nowait clause is not specified.

Each structured block sequence in the sections construct is preceded by a section directive except possibly the first sequence, for which a preceding section directive is optional. The method of scheduling the structured block sequences among the threads in the team is implementation defined.

Execution Model Events

The sections-begin event occurs after an implicit task encounters a sections construct but before the task executes any structured block sequences of the sections region.

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

Tool Callbacks

A thread dispatches a registered ompt_callback_work callback with ompt_scope_begin as its endpoint argument and ompt_work_sections as its work_type argument for each occurrence of a sections-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_sections as its work_type argument for each occurrence of a sections-end event in that thread. The callbacks occur in the context of the implicit task. The callbacks have type signature ompt_callback_work_t.

Cross References

  11.5.3  schedule Clause