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

16.2  cancellation point Construct

Name: cancellation point

Association: none

Category: executable

Properties: default

Clauses

do, for, parallel, sections, taskgroup

Additional information

The cancel-directive-name clause set consists of the directive-name of each directive that has the cancellable property (i.e., directive-name for the worksharing-loop construct, parallel, sections and taskgroup). This clause set has the required, unique and exclusive properties.

Binding

The binding thread set of the cancellation point construct is the current team. The binding region of the cancellation point region is the innermost enclosing region of the type that corresponds to cancel-directive-name.

Semantics

The cancellation point construct introduces a user-defined cancellation point at which an implicit or explicit task must check if cancellation of the innermost enclosing region of the type specified by cancel-directive-name, which must be the directive-name of a cancellable construct, has been activated. This construct does not implement any synchronization between threads or tasks. When an implicit or explicit task reaches a user-defined cancellation point and if the cancel-var ICV is true, then:

Execution Model Events

The cancellation event occurs if a task encounters a cancellation point and detects the activation of cancellation.

Tool Callbacks

A thread dispatches a registered ompt_callback_cancel callback for each occurrence of a cancel event in the context of the encountering task. This callback has type signature ompt_callback_cancel_t; (flags & ompt_cancel_detected) always evaluates to true in the dispatched callback; (flags & ompt_cancel_parallel) evaluates to true in the dispatched callback if cancel-directive-name of the encountered cancellation point construct is parallel; (flags & ompt_cancel_sections) evaluates to true in the dispatched callback if cancel-directive-name of the encountered cancellation point construct is sections; (flags & ompt_cancel_loop) evaluates to true in the dispatched callback if cancel-directive-name of the encountered cancellation point construct is for or do; and (flags & ompt_cancel_taskgroup) evaluates to true in the dispatched callback if cancel-directive-name of the encountered cancellation point construct is taskgroup.

Restrictions

Restrictions to the cancellation point construct are as follows:

Cross References