#pragma omp flush Preprocessor Directive (C Only)

The omp flush directive identifies a point at which the compiler ensures that all threads in a parallel region have the same view of specified objects in memory.

Syntax

#pragma omp flush [ (list) ]

where list is a comma-separated list of variables that will be synchronized.

Notes
If list includes a pointer, the pointer is flushed, not the object being referred to by the pointer. If list is not specified, all shared objects are synchronized except those inaccessible with automatic storage duration.

An implied flush directive appears in conjuction with the following directives:

The omp flush directive must appear within a block or compound statement. For example:

if (x!=0) {
   #pragma omp flush    /* valid usage    */
}
if (x!=0)
   #pragma omp flush    /* invalid usage  */


Program Parallelization
Shared and Private Variables in a Parallel Environment
Countable Loops


Control Parallel Processing with Pragmas


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