Parallel Algorithms A Simple Model for Parallel Processing

Slides:



Advertisements
Similar presentations
1 Parallel Algorithms (chap. 30, 1 st edition) Parallel: perform more than one operation at a time. PRAM model: Parallel Random Access Model. p0p0 p1p1.
Advertisements

Parallel Algorithms.
PRAM Algorithms Sathish Vadhiyar. PRAM Model - Introduction Parallel Random Access Machine Allows parallel-algorithm designers to treat processing power.
Optimal PRAM algorithms: Efficiency of concurrent writing “Computer science is no more about computers than astronomy is about telescopes.” Edsger Dijkstra.
Parallel vs Sequential Algorithms
Advanced Algorithms Piyush Kumar (Lecture 12: Parallel Algorithms) Welcome to COT5405 Courtesy Baker 05.
PRAM (Parallel Random Access Machine)
Efficient Parallel Algorithms COMP308
TECH Computer Science Parallel Algorithms  several operations can be executed at the same time  many problems are most naturally modeled with parallelism.
Advanced Topics in Algorithms and Data Structures Classification of the PRAM model In the PRAM model, processors communicate by reading from and writing.
PRAM Models Advanced Algorithms & Data Structures Lecture Theme 13 Prof. Dr. Th. Ottmann Summer Semester 2006.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
Simulating a CRCW algorithm with an EREW algorithm Efficient Parallel Algorithms COMP308.
Advanced Topics in Algorithms and Data Structures
Slide 1 Parallel Computation Models Lecture 3 Lecture 4.
Introduction to Analysis of Algorithms
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
Sorting, Searching, and Simulation in the MapReduce Framework Michael T. Goodrich Dept. of Computer Science.
Steve Lantz Computing and Information Science Parallel Performance Week 7 Lecture Notes.
Parallel Algorithms - Introduction Advanced Algorithms & Data Structures Lecture Theme 11 Prof. Dr. Th. Ottmann Summer Semester 2006.
1 Lecture 3 PRAM Algorithms Parallel Computing Fall 2008.
Analysis of Algorithms COMP171 Fall Analysis of Algorithms / Slide 2 Introduction * What is Algorithm? n a clearly specified set of simple instructions.
Basic PRAM algorithms Problem 1. Min of n numbers Problem 2. Computing a position of the first one in the sequence of 0’s and 1’s.
Simulating a CRCW algorithm with an EREW algorithm Lecture 4 Efficient Parallel Algorithms COMP308.
RAM and Parallel RAM (PRAM). Why models? What is a machine model? – A abstraction describes the operation of a machine. – Allowing to associate a value.
DATA STRUCTURES AND ALGORITHMS Lecture Notes 1 Prepared by İnanç TAHRALI.
Algorithm Analysis (Big O)
Complexity Classes Kang Yu 1. NP NP : nondeterministic polynomial time NP-complete : 1.In NP (can be verified in polynomial time) 2.Every problem in NP.
1 Lecture 2: Parallel computational models. 2  Turing machine  RAM (Figure )  Logic circuit model RAM (Random Access Machine) Operations supposed to.
Week 2 CS 361: Advanced Data Structures and Algorithms
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 8, 2005 Session 8.
Parallel Algorithms Sorting and more. Keep hardware in mind When considering ‘parallel’ algorithms, – We have to have an understanding of the hardware.
1 Lectures on Parallel and Distributed Algorithms COMP 523: Advanced Algorithmic Techniques Lecturer: Dariusz Kowalski Lectures on Parallel and Distributed.
RAM, PRAM, and LogP models
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 3, 2005 Session 7.
Parallel Algorithms. Parallel Models u Hypercube u Butterfly u Fully Connected u Other Networks u Shared Memory v.s. Distributed Memory u SIMD v.s. MIMD.
Parallel computation Section 10.5 Giorgi Japaridze Theory of Computability.
06/12/2015Applied Algorithmics - week41 Non-periodicity and witnesses  Periodicity - continued If string w=w[0..n-1] has periodicity p if w[i]=w[i+p],
Basic Linear Algebra Subroutines (BLAS) – 3 levels of operations Memory hierarchy efficiently exploited by higher level BLAS BLASMemor y Refs. FlopsFlops/
Algorithm Analysis (Big O)
E.G.M. PetrakisAlgorithm Analysis1  Algorithms that are equally correct can vary in their utilization of computational resources  time and memory  a.
Searching Topics Sequential Search Binary Search.
3/12/2013Computer Engg, IIT(BHU)1 PRAM ALGORITHMS-3.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 4.
3/12/2013Computer Engg, IIT(BHU)1 PRAM ALGORITHMS-1.
1 A simple parallel algorithm Adding n numbers in parallel.
Classification of parallel computers Limitations of parallel processing.
Algorithm Complexity is concerned about how fast or slow particular algorithm performs.
Complexity Analysis (Part I)
PRAM and Parallel Computing
Lecture 3: Parallel Algorithm Design
PRAM Model for Parallel Computation
Analysis of Algorithms
Lecture 2: Parallel computational models
Algorithm Analysis CSE 2011 Winter September 2018.
Lecture 22 review PRAM: A model developed for parallel machines
Algorithms Furqan Majeed.
PRAM Algorithms.
PRAM Model for Parallel Computation
Algorithm Analysis Neil Tang 01/22/2008
Algorithm Analysis (not included in any exams!)
Parallel and Distributed Algorithms
Part 2: Parallel Models (II)
CSE838 Lecture notes copy right: Moon Jung Chung
Unit –VIII PRAM Algorithms.
Module 6: Introduction to Parallel Computing
Estimating Algorithm Performance
Complexity Analysis (Part I)
Complexity Analysis (Part I)
Presentation transcript:

Parallel Algorithms A Simple Model for Parallel Processing several operations can be executed at the same time many problems are most naturally modeled with parallelism A Simple Model for Parallel Processing Approaches to the design of parallel algorithms Speedup and Efficiency of parallel algorithms A class of problems NC Parallel algorithms, e.g.

A Simple Model for Parallel Processing Parallel Random Access Machine (PRAM) model a number of processors all can access a large share memory all processors are synchronized all processor running the same program each processor has an unique id, pid. and may instruct to do different things depending on their pid

PRAM models PRAM models vary according how they handle write conflicts The models differ in how fast they can solve various problems. Concurrent Read Exclusive Write (CREW) only one processor are allow to write to one particular memory cell at any one step Concurrent Read Concurrent Write (CRCW) Algorithm works correctly for CREW will also works correctly for CRCW but not vice versa

Approaches to the design of parallel algorithms Modify an existing sequential algorithm exploiting those parts of the algorithm that are naturally parallelizable. Design a completely new parallel algorithm that may have no natural sequential analog. Brute force Methods for parallel processing: Using an existing sequential algorithm but each processor using differential initial conditions Using compiler to optimize sequential algorithm Using advanced CPU to optimize code

Speedup and Efficiency of parallel algorithms Let T*(n) be the time complexity of a sequential algorithm to solve a problem P of input size n Let Tp(n) be the time complexity of a parallel algorithm to solves P on a parallel computer with p processors Speedup Sp(n) = T*(n) / Tp(n) Sp(n) <= p Best possible, Sp(n) = p when Tp(n) = T*(n)/p Efficiency Ep(n) = T1(n) / (p Tp(n)) where T1(n) is when the parallel algorithm run in 1 processor Best possible, Ep(n) = 1

A class of problems NC The class NC consists of problems that Theorem: can be solved by parallel algorithm using polynomially bounded number of processors p(n) p(n)  O(nk) for problem size n and some constant k the number of time steps bounded by a polynomial in the logarithm of the problem size n T(n)  O( (log n)m ) for some constant m Theorem: NC  P

Parallel algorithms, e.g. Binary Fan-In Technique

Algorithm: Parallel Tournament for Max Algorithm:Parallel Tournament for Maximum Input: Keys x[0],x[1],....x[n-1], initially in memory cells M[0] ,...,M[n-1], and integer n. Output:The largest key will be left in M[0]. parTournamentMax(M,n) int incr Write -(some very small value) into M[n+pid] incr=1; while(incr<n) key big, temp0,temp1; Read M[pid] into temp0 Read M[pid+incr] into temp1 big=max(temp0,temp1); Write big into M[pid]. incr=2*incr; Analysis: Use n processor and (log n) time

Algorithm: Finding Max in Constant Time CRCW method

Algorithm: Common-Write Max of n Keys Uses n2 processors, does only three read/write steps!