Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture materials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
generic software skills
lecture materials
Commits
2684116e
Commit
2684116e
authored
11 months ago
by
Georgiana Mania
Browse files
Options
Downloads
Patches
Plain Diff
add first part of hands-on ex
parent
c8bfa5bd
No related branches found
Branches containing commit
No related tags found
1 merge request
!72
Draft: Compute devices lecture
Pipeline
#68959
passed
11 months ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lectures/parallelism/slides.qmd
+15
-8
15 additions, 8 deletions
lectures/parallelism/slides.qmd
with
15 additions
and
8 deletions
lectures/parallelism/slides.qmd
+
15
−
8
View file @
2684116e
...
...
@@ -67,24 +67,31 @@ FIXME
a[i] = 2 * i;
```
#
# Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
1. Load the GNU comp
l
iler
and compile the code
on Levante
# Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
1. Load the GNU compiler on Levante
```bash
module load gcc
g++ main.cpp -o main
```
2. Compile and run the serial example
```bash
gcc main.c -o serial.x -lm
time ./serial.x # use `time` to check the runtime
```
3. Compile and run the example using OpenMP
```bash
gcc -fopenmp main.c -o parallel.x -lm
OMP_NUM_THREADS=2 time ./parallel.x
```
4. See next slide!
1. Compile and run the example serially. Use `time ./serial.x` to time the execution.
23. Compile and run the example using OpenMP. Use `OMP_NUM_THREADS=2 time ./omp.x` to time the execution.
42. Now add
# Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
4. Now add
* `schedule(static,1)`
* `schedule(static,10)`
* `schedule(FIXMEsomethingelse)`
* `schedule(FIXMEsomethingelse)`
and find out how the OpenMP runtime decomposes the problem domain.
FIXME: Maybe get rid of timings here?
FIXME: Maybe add something varying the number of threads, so that one can see
first ideas of strong/weak scaling.
...
...
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