diff --git a/03-mpi-api/03-mpi-api.tex b/03-mpi-api/03-mpi-api.tex index a9ce1c7..2b94650 100644 --- a/03-mpi-api/03-mpi-api.tex +++ b/03-mpi-api/03-mpi-api.tex @@ -177,14 +177,23 @@ \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} @@ -192,15 +201,24 @@ \section{Collective operations} 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}} @@ -208,11 +226,20 @@ \section{Collective operations} \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}} @@ -220,11 +247,20 @@ \section{Collective operations} \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}} diff --git a/03-mpi-api/03-mpi-api.toc b/03-mpi-api/03-mpi-api.toc new file mode 100644 index 0000000..597ca8b --- /dev/null +++ b/03-mpi-api/03-mpi-api.toc @@ -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} diff --git a/03-mpi-api/images/broadcast.png b/03-mpi-api/images/broadcast.png new file mode 100644 index 0000000..cef56f8 Binary files /dev/null and b/03-mpi-api/images/broadcast.png differ diff --git a/03-mpi-api/images/gather.png b/03-mpi-api/images/gather.png new file mode 100644 index 0000000..c7870d9 Binary files /dev/null and b/03-mpi-api/images/gather.png differ diff --git a/03-mpi-api/images/reduction.png b/03-mpi-api/images/reduction.png new file mode 100644 index 0000000..6e7e08c Binary files /dev/null and b/03-mpi-api/images/reduction.png differ diff --git a/03-mpi-api/images/scatter.png b/03-mpi-api/images/scatter.png new file mode 100644 index 0000000..1ba91a5 Binary files /dev/null and b/03-mpi-api/images/scatter.png differ