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:22] – 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 21: | 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:// | ||
- | |||
- | [[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 48: | 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 209: | 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 231: | Linea 229: | ||
Or use #pragma omp parallel for | Or use #pragma omp parallel for | ||
- | [[http:// | + | Examples: for.c for-schelule.c |
Linea 243: | 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 263: | 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 288: | Linea 286: | ||
} | } | ||
</ | </ | ||
+ | Examples: ex2.c | ||
Linea 312: | Linea 310: | ||
- | [[http:// | + | Examples: reduction.c |
== Combining FOR and reduce == | == Combining FOR and reduce == | ||
Linea 339: | Linea 337: | ||
- | [[http:// | + | Examples: |
roberto.alfieri/pub/openmp.1602692541.txt.gz · Ultima modifica: 14/10/2020 18:22 da roberto.alfieri