Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openmp-lab-exercises
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pdc-summer-school
openmp-lab-exercises
Commits
2008acf3
Commit
2008acf3
authored
Aug 15, 2018
by
Xin Li
Browse files
Options
Downloads
Patches
Plain Diff
adjust image size
parent
463d5d79
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
intro_lab/README.md
+6
-6
6 additions, 6 deletions
intro_lab/README.md
with
6 additions
and
6 deletions
intro_lab/README.md
+
6
−
6
View file @
2008acf3
...
...
@@ -107,17 +107,17 @@ code to calculate the value of pi using the parallel construct.
The figure below shows the numerical technique, we are going to use to calculate pi.

<img
src=
"
image/pi_int.png
"
alt=
"PI_integral"
width=
"350px"
/>
Mathematically, we know that

<img
src=
"
image/pi_eq_1.png
"
alt=
"PI_Eq_1"
width=
"200px"
/>
We can approximate the integral as a sum of rectangles

<img
src=
"
image/pi_eq_2.png
"
alt=
"PI_Eq_2"
width=
"200px"
/>
where each rectangle has width Delta
_
x and height F(x
<sub>
i
</sub>
) at the middle of interval i.
where each rectangle has width
&
Delta
;
x and height F(x
<sub>
i
</sub>
) at the middle of interval i.
A simple serial C code to calculate pi is the following:
...
...
@@ -236,8 +236,8 @@ the execution time for 1, 2, 4, 8, 16, 32 threads.
Hints:
To change the schedule, you can either change the environment variable with
``export OMP_SCHEDULE=
<
type
>
``
where type can be any of static, dynamic, guided or in
the source code as
``omp parallel for schedule(
<
type
>
)``
.
``export OMP_SCHEDULE=type``
where
``
type
``
can be any of static, dynamic, guided or in
the source code as
``omp parallel for schedule(type)``
.
Questions:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment