Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collective operations images to 03-mpi-api #24

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 62 additions & 26 deletions 03-mpi-api/03-mpi-api.tex
Original file line number Diff line number Diff line change
Expand Up @@ -177,54 +177,90 @@ \section{Collective operations}

\texttt{int MPI\_Bcast(void *buffer, int count, MPI\_Datatype datatype, int root, MPI\_Comm comm);}

Parameters:
\begin{itemize}
\item buffer: Starting address of buffer.
\item count: Number of entries in buffer.
\item datatype: Data type of buffer elements.
\item root: Rank of broadcast root.
\item comm: Communicator.
\end{itemize}
\begin{minipage}[t]{0.6\textwidth}
Parameters:
\begin{itemize}
\item buffer: Starting address of buffer.
\item count: Number of entries in buffer.
\item datatype: Data type of buffer elements.
\item root: Rank of broadcast root.
\item comm: Communicator.
\end{itemize}
\end{minipage}
\hfill
\begin{minipage}[t]{0.35\textwidth}
\begin{figure}[h]
\includegraphics[]{images/broadcast.png}
\end{figure}
\end{minipage}
{\footnotesize Source: \href{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}}
\end{frame}

\begin{frame}{Reduction}
Perform a global reduction operation (e.g., sum, max) across all processes. Calculate the total sum of values distributed across processes.

Can be seen as the opposite operation to broadcast.

\texttt{int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);}
\texttt{int MPI\_Reduce(const void *sendbuf, void *recvbuf, int count, MPI\_Datatype datatype, MPI\_Op op, int root, MPI\_Comm comm);}

Supported operations:
\begin{itemize}
\item \texttt{MPI\_SUM}
\item \texttt{MPI\_PROD}
\item \texttt{MPI\_MAX}
\item \texttt{MPI\_MIN}
\end{itemize}
\begin{minipage}[t]{0.2\textwidth}
Supported operations:
\begin{itemize}
\item \texttt{MPI\_SUM}
\item \texttt{MPI\_PROD}
\item \texttt{MPI\_MAX}
\item \texttt{MPI\_MIN}
\end{itemize}
\end{minipage}
\hfill
\begin{minipage}[t]{0.75\textwidth}
\begin{figure}[h]
\includegraphics[]{images/reduction.png}
\end{figure}
\end{minipage}
{\footnotesize Source: \href{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}}
\end{frame}

\begin{frame}{\texttt{MPI\_Gather}}
Collect data from all processes to a single root process.

\texttt{int MPI\_Gather(const void *sendbuf, int sendcount, MPI\_Datatype sendtype, void *recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm);}

Parameters:
\begin{itemize}
\item sendbuf: Starting address of send buffer.
\item recvbuf: Starting address of receive buffer (significant only at root).
\end{itemize}
\begin{minipage}[t]{0.6\textwidth}
Parameters:
\begin{itemize}
\item sendbuf: Starting address of send buffer.
\item recvbuf: Starting address of receive buffer (significant only at root).
\end{itemize}
\end{minipage}
\hfill
\begin{minipage}[t]{0.35\textwidth}
\begin{figure}[h]
\includegraphics[]{images/gather.png}
\end{figure}
\end{minipage}
{\footnotesize Source: \href{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}}
\end{frame}

\begin{frame}{\texttt{MPI\_Scatter}}
Distribute distinct chunks of data from root to all processes.

\texttt{int MPI\_Scatter(const void *sendbuf, int sendcount, MPI\_Datatype sendtype, void *recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm);}

Parameters:
\begin{itemize}
\item \texttt{sendbuf}: Starting address of send buffer (significant only at root).
\item \texttt{recvbuf}: Starting address of receive buffer.
\end{itemize}
\begin{minipage}[t]{0.6\textwidth}
Parameters:
\begin{itemize}
\item \texttt{sendbuf}: Starting address of send buffer (significant only at root).
\item \texttt{recvbuf}: Starting address of receive buffer.
\end{itemize}
\end{minipage}
\hfill
\begin{minipage}[t]{0.35\textwidth}
\begin{figure}[h]
\includegraphics[]{images/gather.png}
\end{figure}
\end{minipage}
{\footnotesize Source: \href{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}{https://pdc-support.github.io/introduction-to-mpi/07-collective/index.html}}
\end{frame}

\begin{frame}{\texttt{MPI\_AllGather}}
Expand Down
3 changes: 3 additions & 0 deletions 03-mpi-api/03-mpi-api.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\beamer@sectionintoc {1}{Advanced Send/Receive API}{3}{0}{1}
\beamer@sectionintoc {2}{Synchronization}{6}{0}{2}
\beamer@sectionintoc {3}{Collective operations}{8}{0}{3}
Binary file added 03-mpi-api/images/broadcast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 03-mpi-api/images/gather.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 03-mpi-api/images/reduction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 03-mpi-api/images/scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading