Parallel Algo C Sar
Parallel Algo C Sar
Agenda
Architecture Parallel Programming Languages Precedence Graph Elementary Parallel Algorithms Sorting Matrix Multiplication Download :http://www.cs.montana.edu/~atanu.roy/Classes/ CS515.html
Architecture
Flynns Classification S = single , M = multiple , I = instruction (stream), D = data (stream)
SISD
SIMD
Architecture
Flynns Classification S = single , M = multiple , I = instruction (stream), D = data (stream)
MISD
MIMD
Chordal ring
Tree
Tree Cont.
FAT TREE
STAR
Hypercube
100 000 110
010
101 111
5-D
Message-passing
Fortran 90/HPF , C++ , HEP CSP , Ada , OCCAM (Von PL/I , Ada , Concurrent Neumann Language Pascal Modula-2 , MultiLisp Extension ) (MIMD), Lisp Connection Machine (SIMD) VAL , ID LAU , SISAL ( dataflow languages )
Concurrent Prolog ( Shapiro ) Actors FP
Data driven
Pattern driven Demand driven ( reduction language )
A
parbegin C begin B parbegin D E parend G end parend H
Broadcast in a Hypercube
Algorithm 1
Algorithm 2
Pseudocode
Proc MERGE-SPLIT(S)
for i:= 1 to p do in parallel
QUICKSORT(Si)
end for for (i := 1 to ceil(p/2)) for odd-numbered processor do in parallel MERGE(Si , Si + 1) SPLIT end for for odd-numbered processor do in parallel MERGE(Si , Si + 1) SPLIT end for end for
Input : {23, 6, 1, 5, 11, 13, 55, 19, -3, 12, -5, -7, 9, 55, 28, -2}
Shuffle-Exchange Network
Bitonic Mergesort on Shuffle-Exchange Network A list of n = 2k unsorted elements can be sorted in time (lg2 n) with a network 2k-1[k (k-1) + 1] comparators using the shuffle-exchange network.
Sorting Network
Home Work
Show how the following 16 values would be sorted by Batchers Bitonic sort. 16, 7, 4, 12, 2, 10, 13, 9, 1, 8, 11, 3, 15, 6, 5, 14