HOME
| OPENMP API Specification: Version 5.0 November 2018

2.18.2  cancellation point Construct

SummaryThe cancellation point construct introduces a user-defined cancellation point at which implicit or explicit tasks check if cancellation of the innermost enclosing region of the type specified has been activated. The cancellation point construct is a stand-alone directive.

Syntax

SVG-Viewer needed.

The syntax of the cancellation point construct is as follows:  

 
#pragma omp cancellation point construct-type-clause new-line  

where construct-type-clause is one of the following:  

 
parallel 
sections 
for 
taskgroup  

SVG-Viewer needed.

SVG-Viewer needed.

The syntax of the cancellation point construct is as follows:  

 
!$omp cancellation point construct-type-clause  

where construct-type-clause is one of the following:  

 
parallel 
sections 
do 
taskgroup  

SVG-Viewer needed.

BindingThe 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 corresponding to the construct-type-clause specified in the directive (that is, the innermost parallel, sections, worksharing-loop, or taskgroup region).

DescriptionThis directive 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 in the clause has been requested. 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 detected 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 construct-type-clause of the encountered cancellation point construct is parallel; (flags & ompt_cancel_sections) evaluates to true in the dispatched callback if construct-type-clause of the encountered cancellation point construct is sections; (flags & ompt_cancel_loop) evaluates to true in the dispatched callback if construct-type-clause of the encountered cancellation point construct is for or do; and (flags & ompt_cancel_taskgroup) evaluates to true in the dispatched callback if construct-type-clause of the encountered cancellation point construct is taskgroup.

Restrictions

Cross References