You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 03-mpi-api/03-mpi-api.tex
+18-67Lines changed: 18 additions & 67 deletions
Original file line number
Diff line number
Diff line change
@@ -71,61 +71,6 @@
71
71
\tableofcontents
72
72
\end{frame}
73
73
74
-
\section{Boost.MPI}
75
-
76
-
\begin{frame}{Boost.MPI}
77
-
Boost.MPI is a part of the Boost C++ libraries that provides C++ bindings for the Message Passing Interface (MPI).
78
-
79
-
Boost.MPI makes it easier to write distributed applications in C++ by wrapping the complex MPI API with C++-friendly abstractions, improving safety and reducing the amount of boilerplate code.
80
-
81
-
Key Features of Boost.MPI:
82
-
\begin{itemize}
83
-
\item Simplified use of MPI with C++ bindings.
84
-
\item Supports complex data types through Boost.Serialization.
85
-
\item Easier management of distributed tasks and communication.
86
-
\item Compatible with common MPI implementations like MPICH, OpenMPI, MS MPI, etc.
87
-
\end{itemize}
88
-
89
-
Note: C API mappting ot Boost.MPI: \href{https://www.boost.org/doc/libs/1_86_0/doc/html/mpi/c_mapping.html}{link}
90
-
91
-
{\footnotesize For more details see Boost.MPI docs: \href{https://www.boost.org/doc/libs/1_86_0/doc/html/mpi.html}{link}}
92
-
\end{frame}
93
-
94
-
\begin{frame}[fragile]{Boost.MPI example}
95
-
\lstset{style=CStyle, caption=Hello World example with Boost MPI}
96
-
\begin{lstlisting}
97
-
#include <boost/mpi.hpp>
98
-
#include <iostream>
99
-
100
-
// Namespace alias for convenience
101
-
namespace mpi = boost::mpi;
102
-
103
-
int main(int argc, char* argv[]) {
104
-
// Initialize the MPI environment
105
-
mpi::environment env(argc, argv);
106
-
mpi::communicator world;
107
-
108
-
// Get the rank (ID) of the current process and the total number of processes
109
-
int rank = world.rank();
110
-
int size = world.size();
111
-
112
-
if (rank == 0) {
113
-
// If this is the root process (rank 0), send a message to another process
0 commit comments