Skip to content

Commit

Permalink
MPI
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Mar 9, 2014
1 parent a586fb4 commit 3cec128
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
14 changes: 12 additions & 2 deletions documents/Programmierparadigmen/MPI.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ \chapter{MPI}
der den Nachrichtenaustausch bei parallelen Berechnungen auf
verteilten Computersystemen beschreibt.

\section{Erste Schritte}
\inputminted[numbersep=5pt, tabsize=4, frame=lines, label=hello-world.c]{c}{scripts/mpi/hello-world.c}

Das wird \texttt{mpicc hello-world.c} kompiliert.\\
Mit \texttt{mpirun -np 14 scripts/mpi/a.out} werden 14 Kopien des Programms
gestartet.

\section{Syntax}
\section{Beispiele}
\section{Weitere Informationen}
\begin{itemize}
\item \url{http://www.open-mpi.org/}
\end{itemize}

\index{MPI|)}

\index{MPI|)}
Binary file modified documents/Programmierparadigmen/Programmierparadigmen.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions documents/Programmierparadigmen/scripts/mpi/hello-world.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>
#include <mpi.h>
int main (int argc, char** args) {
int size;
int myrank;
MPI_Init(&argc, &args);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
printf("Hello world, I have rank %d out of %d.\n",
myrank, size);
MPI_Finalize();
return 0;
}

0 comments on commit 3cec128

Please sign in to comment.