CANCELLATION POINT
Purpose
The CANCELLATION POINT introduces a user-defined cancellation point, at which the encountering task checks if cancellation of the innermost enclosing region of the specified type has been activated.
Syntax
where type_clause is:Usage
The CANCELLATION POINT directive is a stand-alone directive. It takes effect only when the OMP_CANCELLATION environment variable is set to true. The binding thread set of the cancellation point region is the current team, and the binding region is the innermost enclosing region of the type that is specified in type_clause.
The compiler can add implicit cancellation points in your program. However, you might improve the performance by explicitly setting the CANCELLATION POINT directive.
Note: The CANCELLATION POINT directive
does not guarantee the synchronization between threads or tasks.
Rules
Consider the following location
restrictions of the CANCELLATION POINT directive:
- The CANCELLATION POINT TASKGROUP directive must be nested inside a task construct, and the cancellation point region must be nested inside a taskgroup region.
- The CANCELLATION POINT SECTIONS directive must be nested inside a SECTIONS directive.
- The CANCELLATION POINT PARALLEL directive must be nested inside a PARALLEL directive.
- The CANCELLATION POINT DO directive must be nested inside a DO directive.



