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
072dd2ea
Commit
072dd2ea
authored
11 months ago
by
Claudia Frauen
Browse files
Options
Downloads
Patches
Plain Diff
Added threads graphic
parent
7f431195
No related branches found
Branches containing commit
No related tags found
1 merge request
!72
Draft: Compute devices lecture
Pipeline
#69355
passed
11 months ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lectures/parallelism/slides.qmd
+26
-0
26 additions, 0 deletions
lectures/parallelism/slides.qmd
lectures/parallelism/static/threads.jpg
+0
-0
0 additions, 0 deletions
lectures/parallelism/static/threads.jpg
with
26 additions
and
0 deletions
lectures/parallelism/slides.qmd
+
26
−
0
View file @
072dd2ea
...
@@ -67,15 +67,41 @@ Credit: MPI-M
...
@@ -67,15 +67,41 @@ Credit: MPI-M
* A popular way to parallelize code
* A popular way to parallelize code
* Pragma-based parallelization API
* Pragma-based parallelization API
* You annotate your code with parallel regions and the compiler does the rest
* You annotate your code with parallel regions and the compiler does the rest
```c++
#pragma omp parallel for
for (int i = 0; i < N; ++i)
a[i] = 2 * i;
```
# OpenMP threads
* OpenMP uses something called threads
* OpenMP uses something called threads
* Wait until next week for a definition
* Wait until next week for a definition
:::: {.columns}
::: {.column width="50%"}
<br>
```c++
```c++
N = 8
#pragma omp parallel for
#pragma omp parallel for
for (int i = 0; i < N; ++i)
for (int i = 0; i < N; ++i)
a[i] = 2 * i;
a[i] = 2 * i;
```
```
:::
::: {.column width="50%"}
{width=100%}
:::
::::
# Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
# Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
1. Load the GNU compiler on Levante
1. Load the GNU compiler on Levante
```bash
```bash
...
...
This diff is collapsed.
Click to expand it.
lectures/parallelism/static/threads.jpg
0 → 100644
+
0
−
0
View file @
072dd2ea
23.3 KiB
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