# Clauses

([Main README](README.md))

Clauses can be added in the end of a pragma to specify construct specifics or usage of variables.

**collapse(n)**  
Collapse *n* nested loops

- Allows for more parallelism if threads are idle otherwise

**private([\<var\>])**  
Specifies that each thread should have its own instance of a variable

**firstprivate([\<var\>])**  
Specfies that each thread should have its own instance of a variable.  
Also initializes the variable with its value, because it exists before the parallel construct.

**lastprivate([\<var\>])**  
Specfies that the enclosing context's version of the variable is set equal to the private version of whichever thread executes the final iteration (do-loop construct) or last section (!$omp section).

**shared([\<var\>])**  
Specifies that one or more variables should be shared among all threads.

**reduction(operation:[\<var\>])**  
Specifies that one or more variables that are private to each thread are the subject of a reduction operation at the end of the parallel region.

**copyin([\<var\>])**  
Allows threads to access the main thread's value, for a threadprivate variable.

**copyprivate([\<var\>])**  
Specifies that one or more variables should be shared among all threads.
