Download 1 General Use - Basement
Transcript
User Manual BASEMENT
BASIC SIMULATION ENVIRONMENT
The source code can be compiled as serial
program without support of OpenMP
(compiler
directives
are
treated
as
comments). This may ease debugging of
new implemented application features.
Tab. 1:
5.3.3
OpenMP parallelization –pro and contra
Parallel directives in OpenMP
The basic parallelization construct in OpenMP is the so called “parallel region”. The source
code placed within a parallel region is executed in parallel on a number of threads. At the
end of a parallel region an implicit barrier is automatically set to synchronize the threads.
#pragma omp parallel
{
...
Codeblock;
...
}
...
Codeblock;
...
DomainA
...
Calculat eDomainA();
...
Calculat eDomainB();
...
DomainB
#pragma omp parallel sect ions
{
#pragma omp sect ion
{
Calculat eDomainA();
}
#pragma omp sect ion
{
Calculat eDomainB();
}
}
DomainA
DomainB
Fig. 12: Compiler directives for basic parallelization constructs in OpenMP
U I - 5.3-2
VAW ETH Zürich
Version 7/8/2011