roberto.alfieri:pub:openmp
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| roberto.alfieri:pub:openmp [14/10/2020 18:17] – [Tutorials, external links] roberto.alfieri | roberto.alfieri:pub:openmp [18/03/2022 16:11] (versione attuale) – [What is openMP] roberto.alfieri | ||
|---|---|---|---|
| Linea 1: | Linea 1: | ||
| ====== OpenMP ====== | ====== OpenMP ====== | ||
| + | |||
| + | ====Tutorials, | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | |||
| + | **[[http:// | ||
| + | |||
| + | |||
| + | ==== What is openMP ==== | ||
| [[http:// | [[http:// | ||
| - | [[https:// | ||
| {{: | {{: | ||
| Linea 20: | Linea 29: | ||
| Version 4.0 (July 2013), 4.5 (Nov 2015 ) and 5.0 (Nov 2018) add support for accelerators (target directives), | Version 4.0 (July 2013), 4.5 (Nov 2015 ) and 5.0 (Nov 2018) add support for accelerators (target directives), | ||
| - | [[https:// | ||
| - | ====Tutorials, | ||
| - | |||
| - | [[https:// | ||
| - | - | ||
| - | [[http:// | ||
| === openMP support in the C/C++ Compilers === | === openMP support in the C/C++ Compilers === | ||
| - | http:// | + | https:// |
| GCC: From GCC 6.1, OpenMP 4.5 is fully supported for C and C++ | GCC: From GCC 6.1, OpenMP 4.5 is fully supported for C and C++ | ||
| Linea 45: | Linea 47: | ||
| </ | </ | ||
| - | INTEL: | ||
| == How to compile with openMP library == | == How to compile with openMP library == | ||
| - | Compile with -fopenmp | + | Compile with -fopenmp |
| ===== Execution model ===== | ===== Execution model ===== | ||
| Linea 206: | Linea 207: | ||
| A parallel region is a block of code that will be executed by multiple threads. This is the fundamental OpenMP parallel construct. | A parallel region is a block of code that will be executed by multiple threads. This is the fundamental OpenMP parallel construct. | ||
| - | Examples: ex1.c ex2.c [[http:// | + | Examples: ex1.c ex2.c parallel-single.c |
| Linea 228: | Linea 229: | ||
| Or use #pragma omp parallel for | Or use #pragma omp parallel for | ||
| - | [[http:// | + | Examples: for.c for-schelule.c |
| Linea 240: | Linea 241: | ||
| All other threads on the team skip this section of code. | All other threads on the team skip this section of code. | ||
| - | [[http:// | + | Examples: |
| ==== Sections Directive ==== | ==== Sections Directive ==== | ||
| Linea 260: | Linea 261: | ||
| There is an implied barrier at the end of a SECTIONS directive | There is an implied barrier at the end of a SECTIONS directive | ||
| - | [[http:// | + | Examples: sections.c |
| ==== Critical | ==== Critical | ||
| Linea 285: | Linea 286: | ||
| } | } | ||
| </ | </ | ||
| + | Examples: ex2.c | ||
| Linea 309: | Linea 310: | ||
| - | [[http:// | + | Examples: reduction.c |
| == Combining FOR and reduce == | == Combining FOR and reduce == | ||
| Linea 336: | Linea 337: | ||
| - | [[http:// | + | Examples: |
roberto.alfieri/pub/openmp.1602692266.txt.gz · Ultima modifica: 14/10/2020 18:17 da roberto.alfieri
