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

add collectives slide

parent ce2b537b
No related branches found
No related tags found
1 merge request!72Draft: Compute devices lecture
......@@ -37,14 +37,37 @@ If we want to scale beyond one node, what do we need in our example?
* Often used for boundary exchange
* A lot of the details are beyond the scope of this lecture.
## Collectives
* Acts collectively on all ranks.
* Can do:
* Broadcast
* Gather
* Scatter
* Reductions
* All-to-all (why is all-to-all a bad idea for boundary exchange?)
## Collectives
* Collective communication that involves a group of processes (ranks)
* Examples: broadcast, gather, scatter, reduction ...
* All-to-all is a bad idea for boundary exchange
* Read more on [mpi-forum.org](https://www.mpi-forum.org/docs/mpi-1.1/mpi-11-html/node64.html)
## Collectives - Aggregate results
```C++
int MPI_Reduce(void* sendbuf, void* recvbuf, int count,
MPI_Datatype datatype,
MPI_Op op, // MPI_SUM, MPI_MAX, ...
int root,
MPI_Comm comm)
```
<br>
:::fragment
![](static/reduce.jpg){.nostretch fig-align="center" width="70%"}
:::{.info .smaller}
MPI_MAX for 4 ranks and count=2
:::
:::
## Hands-on Session! {background-color=var(--dark-bg-color) .leftalign}
......
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