#pragma omp single Preprocessor Directive (C Only)

The omp single directive identifies a section of code that must be run by a single available thread.

Syntax

#pragma omp single [clause[ clause] ...] 
   statement_block

where clause is any of the following:

private (list) Declares the scope of the data variables in list to be private to each thread. Data variables in list are separated by commas.
firstprivate (list) Declares the scope of the data variables in list to be private to each thread. Each new private object is initialized as if there was an implied declaration within the statement block. Data variables in list are separated by commas.
nowait Use this clause to avoid the implied barrier at the end of the single directive. Only one nowait clause can appear on a given single directive.

Notes
An implied barrier exists at the end of a parallelized statement block unless the nowait clause is specified.



Program Parallelization
Shared and Private Variables in a Parallel Environment


Control Parallel Processing with Pragmas


#pragma Preprocessor Directives for Parallel Processing
OpenMP Run-time Options for Parallel Processing