OpenMP: parallel regions and loop parallelism
Contents
OpenMP: parallel regions and loop parallelism#
Loop parallelism#
Very common type of parallelism in scientific code
In previous trapezoid example, we calculate the division of iteration manually.
An alternative is to use
parallel for
pragma
Hands-on 1: Sum series implementation#
In the EXPLORER window, right-click on
openmp
and selectNew File
.Type
sum_series_for.c
as the file name and hits Enter.
Hands-on 2: Improving sum series implementation#
In the EXPLORER window, right-click on
openmp
and selectNew File
.Type
sum_series_for_2.c
as the file name and hits Enter.