Skip to content
Snippets Groups Projects
Commit add8a649 authored by Jan Frederik Engels's avatar Jan Frederik Engels :new_moon:
Browse files

Some progress.

parent 625e2593
No related branches found
No related tags found
1 merge request!72Draft: Compute devices lecture
Pipeline #69533 passed
......@@ -52,7 +52,7 @@ website:
- "exercises/user-experience.qmd"
# - "exercises/testing.qmd"
# - "exercises/git2.qmd"
# - "exercises/parallelism.qmd"
- "exercises/parallelism.qmd"
# - "exercises/hardware.qmd"
# - "exercises/file_and_data_systems.qmd"
# - "exercises/memory_hierarchies.qmd"
......
---
title: "Parallelism"
author: "CF, GM, JFE FIXME"
author: "Georgiana Mania, Claudia Frauen, Jan Frederik Engels"
---
# Motivation
......@@ -11,18 +11,14 @@ author: "CF, GM, JFE FIXME"
* Use independent compute resources for each piece
* Outlook for next week: The individual computing element does no longer
get much faster, but there are more of them
* FIXME: What else?
## This lecture
* Is mostly about parallelism as a concept
* Next week: Hardware using this concept
* Next week: Complications due to existing hardware
[comment]: # (Thinking about it, I think we should not give a theoretical definition here,
but first give the example and explain parallelism there. Eventually, with the
task-parallelism we should probably give a real definition and different flavours.)
# Our example problem
......@@ -41,8 +37,16 @@ FIXME show plot of a soliton
::::
# Our example problem
FIXME
show some central loop
```c
while ( t < 50 ){
//[...]
for(i=0; i<npoints; i++){
//[...]
u[i]=u2[i]-(delta_t/delta_x)*lu(h1,u1,i);
h[i]=h2[i]-(delta_t/delta_x)*lh(h1,u1,i);
}
}
```
# Decomposing problem domains
## Our problem domain
......@@ -115,8 +119,11 @@ 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
time OMP_NUM_THREADS=2 ./parallel.x
```
FIXME: time is often a shell builtin, so output varies and also the place
where the env-var needs to be set.
4. See next slide!
# Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
......@@ -442,15 +449,6 @@ S1 and S2 can NOT be executed in parallel!
* Parallelisation should not change the results! Exceptions to be discussed next week!
# FIXME
* Homework:
* Revisit `schedule` and try `dynamic` and explain why that happens.
* Parallelize the loop in `maxval`.
* Do a strong-scaling experiment starting with 2 threads and up to 32
threads and plot the result.
* If you were to increase the number of threads, do you expect the speedup
to continue indefinitely? If not, which limits can you imagine? Feel free
to use kitchen metaphors.
# Additional reading
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment