Parallel algorithms for expression evaluation Simultaneous substitution method (SimSub)

Slides:



Advertisements
Similar presentations
Single Source Shortest Paths
Advertisements

Parallel algorithms for expression evaluation Part1. Simultaneous substitution method (SimSub) Part2. A parallel pebble game.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Jeffrey D. Ullman Stanford University. 2  A set of nodes N and edges E is a region if: 1.There is a header h in N that dominates all nodes in N. 2.If.
22C:19 Discrete Structures Induction and Recursion Fall 2014 Sukumar Ghosh.
Code Generation Steve Johnson. May 23, 2005Copyright (c) Stephen C. Johnson The Problem Given an expression tree and a machine architecture, generate.
Lecture 3: Parallel Algorithm Design
Exact Inference in Bayes Nets
A parallel pebble game with applications to expression evaluation Lecture 11.
April 9, 2015Applied Discrete Mathematics Week 9: Relations 1 Solving Recurrence Relations Another Example: Give an explicit formula for the Fibonacci.
Lectures on Network Flows
Advanced Topics in Algorithms and Data Structures 1 Rooting a tree For doing any tree computation, we need to know the parent p ( v ) for each node v.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
Boolean Algebra Applications1 BOOLEAN ALGEBRA APPLICATIONS RELIABILITY OF CIRCUITS.
Balanced Graph Partitioning Konstantin Andreev Harald Räcke.
A Schedulability-Preserving Transformation of BDF to Petri Nets Cong Liu EECS 290n Class Project December 10, 2004.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Tree Contraction Label leaf nodes 1...n –Rake odd indexed leaf nodes –Left Compress –Right Compress –Left Compress –Right Compress Key: avoid memory conflicts.
The Euler-tour technique
Complexity 19-1 Parallel Computation Complexity Andrei Bulatov.
DAST 2005 Week 4 – Some Helpful Material Randomized Quick Sort & Lower bound & General remarks…
The Complexity of Algorithms and the Lower Bounds of Problems
Section Section Summary Recursive Algorithms Proving Recursive Algorithms Correct Recursion and Iteration (not yet included in overheads) Merge.
Advanced Topics in Algorithms and Data Structures 1 Two parallel list ranking algorithms An O (log n ) time and O ( n log n ) work list ranking algorithm.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
Tractable Symmetry Breaking Using Restricted Search Trees Colva M. Roney-Dougal, Ian P. Gent, Tom Kelsey, Steve Linton Presented by: Shant Karakashian.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Truth Table-Based Testing Generating test cases when the test model is a truth table Reading: Binder Chapter 6.
CSCE350 Algorithms and Data Structure Lecture 17 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
Analysis of Algorithms
COSC 2007 Data Structures II Chapter 14 Graphs III.
CSC401: Analysis of Algorithms CSC401 – Analysis of Algorithms Chapter Dynamic Programming Objectives: Present the Dynamic Programming paradigm.
Complexity 20-1 Complexity Andrei Bulatov Parallel Arithmetic.
Data Structures & Algorithms Recursion and Trees Richard Newman.
Winter 2014Parallel Processing, Fundamental ConceptsSlide 1 2 A Taste of Parallel Algorithms Learn about the nature of parallel algorithms and complexity:
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Math Review 1.
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.
TREES General trees Binary trees Binary search trees AVL trees Balanced and Threaded trees.
Theory of Computational Complexity Probability and Computing Ryosuke Sasanuma Iwama and Ito lab M1.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Section Recursion  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
1 Trees. 2 Trees Trees. Binary Trees Tree Traversal.
1 Proving Properties of Recursive Functions and Data Structures CS 270 Math Foundations of CS Jeremy Johnson.
Lecture 3: Parallel Algorithm Design
Top 50 Data Structures Interview Questions
Analysis of Algorithms
Computing Connected Components on Parallel Computers
The minimum cost flow problem
Source Code for Data Structures and Algorithm Analysis in C (Second Edition) – by Weiss
Minimum Spanning Tree 8/7/2018 4:26 AM
Lectures on Network Flows
Design and Analysis of Algorithms
TREES General trees Binary trees Binary search trees AVL trees
Shortest Path Problems
Proving Properties of Recursive Functions and Data Structures
The Complexity of Algorithms and the Lower Bounds of Problems
Binary Search Trees < > =
Data Structures & Algorithms
Richard Anderson Lecture 29 Complexity Theory
Shortest Path Problems
Md. Abul Kashem, Chowdhury Sharif Hasan, and Anupam Bhattacharjee
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Abstraction.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
A Variation of Minimum Latency Problem on Path, Tree and DAG
CS210- Lecture 13 June 28, 2005 Agenda Heaps Complete Binary Tree
Presentation transcript:

Parallel algorithms for expression evaluation Simultaneous substitution method (SimSub)

Simultaneous Substitutions Method (SimSub) x = Expression(y) and y = Expression1 a variable y can be substituted by its expression or by its value if it is known (if Expression1 is a constant) assume we have a sequence of expressions defining variables, each expression is of a constant size variables are numbered and i-th expression depends only on variables with numbers smaller than i e.g. x1=4 x2=x1+5 x3=x1+x2*7 x4=x2*x3

One parallel step: for each expression substitute its variables by their expression if it is safe; safe means that corresponding expression has at most one variable Example: summing the numbers 2, 1, 3, 2, 1, 3, 2, 1 we can write a sequential program x1 = 2; x2 = x1+1; x3 = x2+3; x4 = x3+2; x5 = x4+1; x6 = x5+3; x7 = x6+2 after parallel step 1 x1 = 2; x2 = 3; x3 = x1+4; x4 = x2+5; x5 = x3+3; x6 = x4+4; x7 = x5+5 after parallel step 2 x1 = 2; x2 = 3; x3 = 6; x4 = 8; x5 = x1+7; x6 = x2+9; x7 = x3+8 after parallel step 2 x1 = 2; x2 = 3; x3 = 6; x4 = 8; x5 = 9; x6 = 12; x7 = 14 output = sum = x7 In this way we can sum 1024 numbers in 10 rounds

Tree-contraction ======================================== Parallel algorithms related to expression evaluation correspond to parallel algorithmic technique called tree-contraction =============================================== Tree-contraction is used in parallel expression evaluation Since the structure of a expression is a tree there are different tree-contraction techniques Basic operations are: - redirecting edges of the tree - removing nodes marking (pebbling) nodes - creating additional edges the final aim is to guarantee that logarithmic number of contractions is sufficient

Tree-contraction related to SimSub algorithm

Example Substitutions method works in O(log n) time. In each iteration the active tree is reduced by 1/3 at least. The active tree consists of nodes relevant to the output computation, The root is the output variable (the last one).

F n is the smallest tree which needs n iterations in tree contraction related to SimSub algorithm

How the SimSub algorithm works for general graphs ? sometimes very poor  (e.g. when computing Fibonacci numbers) generally with n processors we need n-1 iterations -only one processor really works each time, so the same can be done with a single processor

SimSub will terminate after O(log (tree-size(graph)) iterations for the dependency graph of Fibonacci numbers tree-size (number of paths) is exponential. There is alternative parallel method SimSub’, see dynamic dependency graphs. programming problems, when we can deal effectively with such types of

Other tree contraction method: parallel pebble game (PPG) Parallel pebble game (PPG) works for full binary trees, full means each father has exactly 2 sons