Complexity 19-1 Parallel Computation Complexity Andrei Bulatov.

Slides:



Advertisements
Similar presentations
Time Complexity P vs NP.
Advertisements

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
Lecture 17 Path Algebra Matrix multiplication of adjacency matrices of directed graphs give important information about the graphs. Manipulating these.
1 Data Structures Performance Analysis. 2 Fundamental Concepts Some fundamental concepts that you should know: –Dynamic memory allocation. –Recursion.
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Complexity 13-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 19-1 Computability and Complexity Andrei Bulatov Non-Deterministic Space.
Tractable and intractable problems for parallel computers
Asymptotic Growth Rate
1 Lecture 4 Analytical Modeling of Parallel Programs Parallel Computing Fall 2008.
Computability and Complexity 32-1 Computability and Complexity Andrei Bulatov Boolean Circuits.
Complexity 19-1 Complexity Andrei Bulatov More Probabilistic Algorithms.
Data Structures Performance Analysis.
Cmpt-225 Algorithm Efficiency.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Lecture 5 Today’s Topics and Learning Objectives Quinn Chapter 7 Predict performance of parallel programs Understand barriers to higher performance.
The Complexity of Algorithms and the Lower Bounds of Problems
Computability and Complexity 17-1 Computability and Complexity Andrei Bulatov Strong NP-Completeness.
Design and Analysis of Algorithms Chapter Analysis of Algorithms Dr. Ying Lu August 28, 2012
Multithreaded Algorithms Andreas Klappenecker. Motivation We have discussed serial algorithms that are suitable for running on a uniprocessor computer.
MCS312: NP-completeness and Approximation Algorithms
CSCE350 Algorithms and Data Structure
Complexity 2-1 Problems and Languages Complexity Andrei Bulatov.
Lecture 2 Computational Complexity
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Analysis of Algorithms
CMSC 341 Asymptotic Analysis. 2 Complexity How many resources will it take to solve a problem of a given size? –time –space Expressed as a function of.
RESOURCES, TRADE-OFFS, AND LIMITATIONS Group 5 8/27/2014.
CS 345: Chapter 10 Parallelism, Concurrency, and Alternative Models Or, Getting Lots of Stuff Done at Once.
Télécom 2A – Algo Complexity (1) Time Complexity and the divide and conquer strategy Or : how to measure algorithm run-time And : design efficient algorithms.
 DATA STRUCTURE DATA STRUCTURE  DATA STRUCTURE OPERATIONS DATA STRUCTURE OPERATIONS  BIG-O NOTATION BIG-O NOTATION  TYPES OF DATA STRUCTURE TYPES.
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Algorithms Growth of Functions. Some Notation NNatural numbers RReal numbers N + Positive natural numbers R + Positive real numbers R * Non-negative real.
Complexity 20-1 Complexity Andrei Bulatov Parallel Arithmetic.
Scaling Area Under a Curve. Why do parallelism? Speedup – solve a problem faster. Accuracy – solve a problem better. Scaling – solve a bigger problem.
MS 101: Algorithms Instructor Neelima Gupta
Data Structure Introduction.
Parallel computation Section 10.5 Giorgi Japaridze Theory of Computability.
CMSC 341 Asymptotic Analysis. 2 Complexity How many resources will it take to solve a problem of a given size? –time –space Expressed as a function of.
Algorithm Analysis (Big O)
Computer Science Background for Biologists CSC 487/687 Computing for Bioinformatics Fall 2005.
Graph Theory. undirected graph node: a, b, c, d, e, f edge: (a, b), (a, c), (b, c), (b, e), (c, d), (c, f), (d, e), (d, f), (e, f) subgraph.
Computability and Complexity 2-1 Problems and Languages Computability and Complexity Andrei Bulatov.
Costas Busch - LSU1 Time Complexity. Costas Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
Scaling Conway’s Game of Life. Why do parallelism? Speedup – solve a problem faster. Accuracy – solve a problem better. Scaling – solve a bigger problem.
Complexity 24-1 Complexity Andrei Bulatov Interactive Proofs.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. Fast.
Prof. Busch - LSU1 Time Complexity. Prof. Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Complexity of Algorithms Fundamental Data Structures and Algorithms Ananda Guna January 13, 2005.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong
Mathematical Foundations (Growth Functions) Neelima Gupta Department of Computer Science University of Delhi people.du.ac.in/~ngupta.
The NP class. NP-completeness
PERFORMANCE EVALUATIONS
Theoretical analysis of time efficiency
COMP108 Algorithmic Foundations Algorithm efficiency
Computability and Complexity
Complexity 6-1 The Class P Complexity Andrei Bulatov.
CSCI 2670 Introduction to Theory of Computing
Numerical Algorithms Quiz questions
Chapter 2.
Chapter 11 Limitations of Algorithm Power
PERFORMANCE MEASURES. COMPUTATIONAL MODELS Equal Duration Model:  It is assumed that a given task can be divided into n equal subtasks, each of which.
Time Complexity and the divide and conquer strategy
Presentation transcript:

Complexity 19-1 Parallel Computation Complexity Andrei Bulatov

… Multiprocessor Computation Complexity 19-2 Multiprocessor Computation Obviously, several communicating processors often can solve problems faster than a single processor processor1 processor2 processor3 … processorn memory1 memory2 memory3 memoryn shared memory

Complexity 19-3 Assumptions Exchanging messages takes no time (one step in the other model) Writing to and reading from the memory takes no time and can be shared We can use as many processors as we wish (for different instances of the same problem different number of processors can be used), but this number is polynomial in the size of the input from the point of view of complexity theory, fixed number of processors makes no sense — it gives only constant speed up - we need to reveal “true” parallelism in algorithms an algorithm with unlimited number of processors can be “scaled” to an algorithm with fixed number of processors

Example Given two matrices compute their product Recall that Complexity 19-4 Example Given two matrices compute their product Recall that Straightforward computation of C can be done in Can we do better with parallel computation? Obviously, yes: use a separate processor for each of the multiplications (denote it ); then use to compute the sum for Totally, we need time

We have obtained polynomial speed-up Complexity 19-5 We have obtained polynomial speed-up This is not sufficient: changing the model of sequential computation it is possible to get some polynomial speed-up We seek for exponential drop in the time required, that is an algorithm that works in or at least

Fast Algorithm for Matrix Multiplication Complexity 19-6 Fast Algorithm for Matrix Multiplication O(log n) steps Thus, C can be computed in

Complexity 19-7 Complexity Measures We solved the Matrix Multiplication problem using processors in steps These two numbers constitute the complexity measure for parallel algorithms: number of processors time complexity As we parallelized an algorithm of time complexity the total amount of work done by a parallel algorithm cannot be less than So the minimal number of processors required is

Complexity 19-8 Brent’s Principle Our algorithm can be improved so that this theoretical bound is achieved compute in log n “shifts” using processors at each shift use the same processors to compute the first log log n parallel additions complete computation as before Since the total number of steps is at most 2 log n, this algorithm works in O(log n) Brent’s Principle If there is a parallelization, A, of a sequential algorithm that works in O(f(n)), such that the time complexity of A is g(n), then there is a parallelization, B, of the same algorithm such that B works in O(g(n)) and uses processors

Graph Reachability Reachability Complexity 19-9 Graph Reachability Instance: A finite directed graph G and vertices s and t Question: Is there a path from s to t? Reachability The natural algorithm for Reachability (breadth-first search) cannot be parallelized in an obvious way Even if many processors are arranged to process nodes from the stack, we cannot stop before a path is found that requires at least as many steps as the length of the path, that is up to n – 1 It is suspected that both searches in graphs are inherently sequential

Adjacency Matrix 1 3 4 G 2 What is ? Complexity 19-10 Adjacency Matrix 1 2 3 4 G What is ? if and only if there is a path from i to j of length 2 Therefore, to solve Reachability for all possible pairs of vertices we need to compute This can be done in parallel steps with total work