HOME
| OPENMP API Specification: Version 5.0 November 2018

2.16  master Construct

SummaryThe master construct specifies a structured block that is executed by the master thread of the team.

Syntax

SVG-Viewer needed.

The syntax of the master construct is as follows:  

 
#pragma omp master new-line 
   structured-block  

SVG-Viewer needed.

SVG-Viewer needed.

The syntax of the master construct is as follows:  

 
!$omp master 
   structured-block 
!$omp end master  

SVG-Viewer needed.

BindingThe binding thread set for a master region is the current team. A master region binds to the innermost enclosing parallel region.

DescriptionOnly the master thread of the team that executes the binding parallel region participates in the execution of the structured block of the master region. Other threads in the team do not execute the associated structured block. There is no implied barrier either on entry to, or exit from, the master construct.

Execution Model Events The master-begin event occurs in the master thread of a team that encounters the master construct on entry to the master region.

The master-end event occurs in the master thread of a team that encounters the master construct on exit from the master region.

Tool Callbacks A thread dispatches a registered ompt_callback_master callback with ompt_scope_begin as its endpoint argument for each occurrence of a master-begin event in that thread. Similarly, a thread dispatches a registered ompt_callback_master callback with ompt_scope_end as its endpoint argument for each occurrence of a master-end event in that thread. These callbacks occur in the context of the task executed by the master thread and have the type signature ompt_callback_master_t.

Restrictions

SVG-Viewer needed.

SVG-Viewer needed.

Cross References