Skip to content

Commit

Permalink
MPI;Prolog; Index ergänzt
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Mar 11, 2014
1 parent 926bf6a commit 00c02a4
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 9 deletions.
3 changes: 2 additions & 1 deletion documents/Programmierparadigmen/Lambda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ \chapter{$\lambda$-Kalkül}
Der untypisierte $\lambda$-Kalkül ist Turing-Äquivalent.
\end{satz}

\section{Reduktionen}
\section{Reduktionen}\index{Reduktionen|(}
\begin{definition}[Redex]\xindex{Redex}%
Eine $\lambda$-Term der Form $(\lambda x. t_1) t_2$ heißt Redex.
\end{definition}
Expand Down Expand Up @@ -87,6 +87,7 @@ \section{Reduktionen}
\begin{beispiel}[$\eta$-Äquivalenz]
TODO
\end{beispiel}
\index{Reduktionen|)}

\section{Auswertungsstrategien}
\begin{definition}[Normalenreihenfolge]\xindex{Normalenreihenfolge}%
Expand Down
42 changes: 36 additions & 6 deletions documents/Programmierparadigmen/MPI.tex
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,44 @@ \section{Funktionen}
\rule{\textwidth}{0.4pt}
\inputminted[numbersep=5pt, tabsize=4]{c}{scripts/mpi/mpi-reduce.c}
Führt eine globale Operation \textbf{op} aus; der Prozeß \enquote{root} erhält das Resultat.

\textbf{Parameter}
\begin{itemize}
\item \textbf{sendbuf}: Startadresse des Sendepuffers
\item \textbf{count}: Anzahl der Elemente im Sendepuffer
\item \textbf{datatype}: Datentyp der Elemente von \texttt{sendbuf}
\item \textbf{op}: auszuführende Operation (handle)
\item \textbf{root}: Rang des Root-Prozesses in comm, der das Ergebnis haben soll
\item \textbf{comm}: Kommunikator (handle)
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\rule{\textwidth}{0.4pt}
\inputminted[numbersep=5pt, tabsize=4]{c}{scripts/mpi/mpi-bcast.c}
Sendet eine Nachricht vom Prozess \texttt{root} an alle anderen Prozesse des
angegebenen Kommunikators.

\textbf{Parameter}
\begin{itemize}
\item \textbf{sendbuf} Startadresse des Sendepuffers
\item \textbf{count} Anzahl der Elemente im Sendepuffer
\item \textbf{datatype} Datentyp der Elemente von \texttt{sendbuf}
\item \textbf{op} auszuführende Operation (handle)
\item \textbf{root} Rang des Root-Prozesses in comm, der das Ergebnis haben soll
\item \textbf{comm} Kommunikator (handle)
\item \textbf{buffer}: Startadresse des Datenpuffers
\item \textbf{count}: Anzahl der Elemente im Puffer
\item \textbf{datatype}: Datentyp der Pufferelemente (handle)
\item \textbf{root}: Wurzelprozeß; der, welcher sendet
\item \textbf{comm}: Kommunikator (handle)
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\rule{\textwidth}{0.4pt}
\inputminted[numbersep=5pt, tabsize=4]{c}{scripts/mpi/mpi-scatter.c}
Verteilt Daten vom Prozess \texttt{root} unter alle anderen Prozesse in der Gruppe, so daß, soweit möglich, alle Prozesse gleich große Anteile erhalten.

\textbf{Parameter}
\begin{itemize}
\item \textbf{sendbuf}: Anfangsadresse des Sendepuffers (Wert ist lediglich für 'root' signifikant)
\item \textbf{sendcount}: Anzahl der Elemente, die jeder Prozeß geschickt bekommen soll (integer)
\item \textbf{sendtype}: Datentyp der Elemente in sendbuf (handle)
\item \textbf{recvcount}: Anzahl der Elemente im Empfangspuffer. Meist ist es günstig, recvcount = sendcount zu wählen.
\item \textbf{recvtype}: Datentyp der Elemente des Empfangspuffers (handle)
\item \textbf{root}: Rang des Prozesses in comm, der die Daten versendet
\item \textbf{comm}: Kommunikator (handle)
\end{itemize}

\textbf{Beispiel}
Expand Down
Binary file modified documents/Programmierparadigmen/Programmierparadigmen.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions documents/Programmierparadigmen/Prolog.tex
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ \subsection{Splits}

\inputminted[numbersep=5pt, tabsize=4]{prolog}{scripts/prolog/splits.sh}

\subsection{Delete}
\inputminted[numbersep=5pt, tabsize=4]{prolog}{scripts/prolog/delete.pl}

\subsection{Zebrarätsel}
Folgendes Rätsel wurde von \url{https://de.wikipedia.org/w/index.php?title=Zebrar%C3%A4tsel&oldid=126585006}
entnommen:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data Bool = False | True
data Color = Red | Green | Blue | Indigo | Violet
data Tree a = Leaf a | Branch (Tree a) (Tree a)
data Point = Point Float Float deriving (Show)
data Point = Point Float Float deriving (Show)
data Tree t = Node t [Tree t]
5 changes: 5 additions & 0 deletions documents/Programmierparadigmen/scripts/haskell/tree-map.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data Tree t = Node t [Tree t]
reduceT :: (t -> t -> t) -> Tree t -> t
reduceT f (Node x []) = x
reduceT f (Node x [y]) = f x y
reduceT f (Node x (y:ys)) = reduceT f (f x y) ys
1 change: 1 addition & 0 deletions documents/Programmierparadigmen/scripts/mpi/mpi-bcast.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MPI_Bcast(buffer, count, datatype, root, comm)
2 changes: 2 additions & 0 deletions documents/Programmierparadigmen/scripts/mpi/mpi-scatter.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MPI_Scatter(sendbuf, sendcount, sendtype, recvbuf,
recvcount, recvtype, root, comm)
2 changes: 2 additions & 0 deletions documents/Programmierparadigmen/scripts/prolog/delete.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
remove([(X,A)|L],X,[(X,ANew)|L]) :- A>0, ANew is A-1.
remove([X|L],Y,[X|L1]) :- remove(L,Y,L1).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// file HelloWorld.x10
public class HelloWorld {
public static def main(args: Array[String](1)){
public static def main(args:Rail[String]) {
x10.io.Console.OUT.println("Hello, World");
}
}

0 comments on commit 00c02a4

Please sign in to comment.