session-4 5
session-4 5
1
PRAM ALGORITHMS
PRAM ALGORITHMS
Introduction:
• So far we have discussed algorithms for single processor
• In this session, we introduce parallel machines
• Example: weather forecasting
• If you start today to forecast tomorrow's weather using single
processor you may get result after few days (since its a
Compute-intensive problem)
PRAM MODEL
•
PRAM(Parallel Random Access Machines):
MERGING:
ODD-EVEN Merge algorithm:
Step 0: If n ≤ 1, return X.
• X1’= 10,7,15,12,5,9,16,20
X2’=25,42,39,37,21,14,8,15
Sort Sort
5,7,9,10,12,15,16,20 8,14,15,21,25,3739,42
Shuffle L : 5, 7,8,10,9,14,12,15,15,20,16,21,25,37,39,42
Compare
5, 7,8,9,10,12,14,15,15,16, 20,21,25,37,39,42
SAMPLE QUESTIONS