13 lines
773 B
Markdown
13 lines
773 B
Markdown
|
OpenMP is a parallelization framework that allows the programmer to easily do thread-level parallelization.
|
||
|
It provides simple compiler directives, with which you mark up the parts of the code, which you want to execute in parallel.
|
||
|
|
||
|
## Knowledge
|
||
|
|
||
|
The simplest compiler directive is the ``#pragma omp parallel``, which opens a parallel region, where the same code is executed on all threads.
|
||
|
You can find all the important directives in the [quick reference](http://openmp.org/mp-documents/OpenMP3.1-CCard.pdf).
|
||
|
Additional details can be found in the full [OpenMP specification](http://www.openmp.org/mp-documents/OpenMP3.1.pdf). For details on OpenMP compiler directives see section 2.
|
||
|
|
||
|
## Task
|
||
|
|
||
|
Use the omp parallel pragma to print the thread number of multiple threads.
|