2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-25 06:18:05 +02:00
This commit is contained in:
Martin Thoma 2014-03-09 19:42:44 +01:00
parent a586fb4f77
commit 3cec128f33
3 changed files with 25 additions and 2 deletions

View file

@ -6,8 +6,18 @@ Message Passing Interface (kurz: MPI) ist ein Standard,
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|)}

View file

@ -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;
}