Skip to content
Snippets Groups Projects
Commit c8bfa5bd authored by Georgiana Mania's avatar Georgiana Mania
Browse files

add slide 26

parent 88c6ceca
No related branches found
No related tags found
1 merge request!72Draft: Compute devices lecture
......@@ -217,8 +217,11 @@ Wikipedia
## Types of parallelism
* Data-level parallelism - what we've been discussing
* Task-level parallelism - Example: Atmosphere ocean coupling
* Data-level parallelism
* what we've been discussing
* Task-level parallelism
* Example: Atmosphere ocean coupling
## Precondition for parallel execution
......@@ -331,6 +334,62 @@ d = c - b; // S2
```
:::
## Bernstein's parallelism conditions {.alignleft}
:::{.fragment .semi-fade-out}
```c++
c = a + b; // S1
d = a - b; // S2
```
:::
:::{.fragment}
Replace `a` with `c` in statement 2
```c++
c = a + b; // S1
d = c - b; // S2
```
:::
:::{.smaller}
:::: {.columns}
::: {.column width="50%"}
:::{.fragment}
Read and write sets for S1 and S2:
$$
R_1 = \{a,b\} ; W_1 = \{c\} \\
R_2 = \{c,b\} ; W_2 = \{d\} \\
$$
:::
:::
::: {.column width="50%"}
:::{.fragment}
Bernstein's conditions:
$$
R_1 \cap W_2 = \emptyset \\
W_1 \cap R_2 = \{c\} \\
W_1 \cap W_2 = \emptyset
$$
:::
:::
:::
::::
:::{.fragment}
S1 and S2 can NOT be executed in parallel!
:::
## Best practices
* Parallelisation should not change the results! Exceptions to be discussed next week!
......
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