Name: sections | Association: block |
Category: executable | Properties: work-distribution, worksharing, thread-limiting, cancellable |
|
Separating directives
sectionClauses
allocate, firstprivate, lastprivate, nowait, private, reductionBinding
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