An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.


Home

OpenMP Directives: Synchronization Constructs: MASTER Directive

Purpose:

The MASTER directive specifies a region that is to be executed only by the master thread of the team. All other threads on the team skip this section of code

There is no implied barrier associated with this directive

Format:

Fortran

!$OMP MASTER

   block

!$OMP END MASTER

C/C++

#pragma omp master  newline 

   structured_block 

Restrictions:

It is illegal to branch into or out of MASTER block.