Martin Thoma 11 years ago
parent
commit
0eaf43e026

+ 18 - 0
documents/Programmierparadigmen/MPI.tex

@@ -117,6 +117,24 @@ Führt eine globale Operation \textbf{op} aus; der Prozeß \enquote{root} erhäl
 \end{itemize}
 \end{itemize}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \goodbreak
 \goodbreak
+\rule{\textwidth}{0.4pt}\xindex{MPI\_Alltoall}%
+\inputminted[numbersep=5pt, tabsize=4]{c}{scripts/mpi/mpi-alltoall.c}
+Teilt Daten von jedem Prozeß einer Gruppe an alle anderen auf.
+
+\textbf{Parameter}
+\begin{itemize}
+    \item \textbf{sendbuf}: Startadresse des Sendepuffers 
+    \item \textbf{sendcount}: Anzahl der Elemente im Sendepuffer
+    \item \textbf{sendtype}: Datentyp der Elemente des Sendepuffers (handle) 
+    \item \textbf{recvcount}: Anzahl der Elemente, die von jedem einzelnen Prozeß empfangen werden
+    \item \textbf{recvtype}: Datentyp der Elemente im Empfangspuffer (handle) 
+    \item \textbf{comm}: Kommunikator (handle)
+\end{itemize}
+
+\textbf{Beispiel}
+\inputminted[numbersep=5pt, tabsize=4]{c}{scripts/mpi/mpi-alltoall-example.c}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\goodbreak
 \rule{\textwidth}{0.4pt}\xindex{MPI\_Bcast}%
 \rule{\textwidth}{0.4pt}\xindex{MPI\_Bcast}%
 \inputminted[numbersep=5pt, tabsize=4]{c}{scripts/mpi/mpi-bcast.c}
 \inputminted[numbersep=5pt, tabsize=4]{c}{scripts/mpi/mpi-bcast.c}
 Sendet eine Nachricht vom Prozess \texttt{root} an alle anderen Prozesse des 
 Sendet eine Nachricht vom Prozess \texttt{root} an alle anderen Prozesse des 

BIN
documents/Programmierparadigmen/Programmierparadigmen.pdf


+ 10 - 0
documents/Programmierparadigmen/scripts/mpi/mpi-alltoall-example.c

@@ -0,0 +1,10 @@
+#include "mpi.h"
+
+int           sendcount, recvcount;
+void          *sendbuf, *recvbuf;
+MPI_Datatype  sendtype, recvtype;
+MPI_Comm      comm;
+...
+MPI_Alltoall(sendbuf, sendcount, sendtype, 
+             recvbuf, recvcount, recvtype, comm);
+...

+ 5 - 0
documents/Programmierparadigmen/scripts/mpi/mpi-alltoall.c

@@ -0,0 +1,5 @@
+int MPI_Alltoall(const void *sendbuf, int sendcount, 
+                 MPI_Datatype sendtype,
+                 void *recvbuf, int recvcount, 
+                 MPI_Datatype recvtype,
+                 MPI_Comm comm)