Docsity

Sequential and Parallel Computing Algorithms-Parallel Processing-Lecture Slides, Slides of Parallel Computing and Programming

Partial preview of the text

Download Sequential and Parallel Computing Algorithms-Parallel Processing-Lecture Slides and more Slides Parallel Computing and Programming in PDF only on Docsity!

Sequential & Parallel Computing

Algorithms

Parallel Algorithms Performance

Evaluation

•^

Algorithmic order of time complexity– O(logn), O(n), O(nlogn), O(n

2 ), O(n

•^

(Parallel) Run time (Tp)–

Compute

  • communication (ignored in PRAM

model)

  • Input data dependence : worst , avg, best

•^

(Parallel) Speed up (Sp)–

T

1

/ T

p

•^

Cost =

T

p^

x p

•^

Efficiency^ = (T

1

x 1)/ (T

p^

x p) = Sp / p

Prefix Sum Computation

•^

Given

n

numbers

x

,x 0

,…,x 1

n-

, the problem is to compute the

sums

s

k^

k i= 0

x

i^

for all

k

between 0 and

n-

•^

Initially,

x

k^

resides on the node labeled

k

, and at the end of the

procedure, the same node holds

S

. k

Sequential Algorithm for Prefix Sum

Procedure Seq-PrefixSum ( X, S)

input : X = x

, x 0

, ……., x 1

n-

output: S = S

, S 0

, …..., S 1

n-

S

0

= x

0

for i := 1 to n-1 do

S

i^

= S

i-

+ x

i^

endfor

endProcedure

Not suitable for Parallel Implementation due to dependency in for loop

Alternate Scheme PrefixSum:

Sequential Algorithm

Sequential & Parallel Algorithm Performance Analysis

Alternate Scheme PrefixSum:

Parallel Algorithm

MIN using PM2I stages for Parallel PrefixSum

Time Complexity???

docsity.com

Sequential Matrix Multiplication

Algorithm: Parallel Matrix Multiplication on

Mesh Systolic Array