Linked List Ranking Parallel Algorithms 1. Work Analysis – Pointer Jumping Number of Steps: Tp = O(Log N) Number of Processors: N Work = O(N log N) T1.

Slides:



Advertisements
Similar presentations
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
Advertisements

General algorithmic techniques: Balanced binary tree technique Doubling technique: List Ranking Problem Divide and concur Lecture 6.
Parallel List Ranking Advanced Algorithms & Data Structures Lecture Theme 17 Prof. Dr. Th. Ottmann Summer Semester 2006.
List Ranking and Parallel Prefix
CS 225 Lab #11 – Skip Lists.
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.
Parallel Algorithms.
List Ranking on GPUs Sathish Vadhiyar. List Ranking on GPUs Linked list prefix computations – computations of prefix sum on the elements contained in.
Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
Hash Tables.
Section 5: More Parallel Algorithms
Datorteknik F1 bild 1 Higher Level Parallelism The PRAM Model Vector Processors Flynn Classification Connection Machine CM-2 (SIMD) Communication Networks.
Advanced Topics in Algorithms and Data Structures
Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar
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.
Fast Algorithms For Hierarchical Range Histogram Constructions
Lecture 3: Parallel Algorithm Design
1 Parallel Parentheses Matching Plus Some Applications.
Advanced Algorithms Piyush Kumar (Lecture 12: Parallel Algorithms) Welcome to COT5405 Courtesy Baker 05.
ISOM MIS 215 Module 7 – Sorting. ISOM Where are we? 2 Intro to Java, Course Java lang. basics Arrays Introduction NewbieProgrammersDevelopersProfessionalsDesigners.
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 Lecture pg 1 Recursion.
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 Lecture 6.1 – pg 1 An overview of lecture 6 A parallel search algorithm A parallel merging algorithm.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
1 Lecture 11 Sorting Parallel Computing Fall 2008.
Accelerated Cascading Advanced Algorithms & Data Structures Lecture Theme 16 Prof. Dr. Th. Ottmann Summer Semester 2006.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 9 Tuesday, 11/20/01 Parallel Algorithms Chapters 28,
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
Skip Lists1 Skip Lists William Pugh: ” Skip Lists: A Probabilistic Alternative to Balanced Trees ”, 1990  S0S0 S1S1 S2S2 S3S3 
Parallel Computers 1 The PRAM Model for Parallel Computation (Chapter 2) References:[2, Akl, Ch 2], [3, Quinn, Ch 2], from references listed for Chapter.
1 Lecture 3 PRAM Algorithms Parallel Computing Fall 2008.
Fall 2008Paradigms for Parallel Algorithms1 Paradigms for Parallel Algorithms.
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.
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.
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.
Project Mentor – Prof. Alan Kaminsky
1 Lecture 2: Parallel computational models. 2  Turing machine  RAM (Figure )  Logic circuit model RAM (Random Access Machine) Operations supposed to.
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.
Graph Algorithms. Definitions and Representation An undirected graph G is a pair (V,E), where V is a finite set of points called vertices and E is a finite.
-1.1- Chapter 2 Abstract Machine Models Lectured by: Nguyễn Đức Thái Prepared by: Thoại Nam.
1 Lectures on Parallel and Distributed Algorithms COMP 523: Advanced Algorithmic Techniques Lecturer: Dariusz Kowalski Lectures on Parallel and Distributed.
1 PRAM Algorithms Sums Prefix Sums by Doubling List Ranking.
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.
3 Data. Software And Data Data Data element – a single, meaningful unit of data. Name Social Security Number Data structure – a set of related data elements.
Skip Lists 二○一七年四月二十五日
Parallel Processing & Distributed Systems Thoai Nam Chapter 2.
5 PRAM and Basic Algorithms
Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar
1 Ch.19 Divide and Conquer. 2 BIRD’S-EYE VIEW Divide and conquer algorithms Decompose a problem instance into several smaller independent instances May.
3/12/2013Computer Engg, IIT(BHU)1 PRAM ALGORITHMS-3.
 2006 Pearson Education, Inc. All rights reserved. 1 Searching and Sorting.
3/12/2013Computer Engg, IIT(BHU)1 PRAM ALGORITHMS-1.
Parallel Computing Chapter 3 - Patterns R. HALVERSON MIDWESTERN STATE UNIVERSITY 1.
PRAM and Parallel Computing
Lecture 3: Parallel Algorithm Design
PRAM Model for Parallel Computation
Parallel Algorithms (chap. 30, 1st edition)
Lecture 2: Parallel computational models
PRAM Algorithms.
PRAM Model for Parallel Computation
Parallel and Distributed Algorithms
Unit –VIII PRAM Algorithms.
Parallel Algorithms A Simple Model for Parallel Processing
List Ranking Moon Jung Chung
Presentation transcript:

Linked List Ranking Parallel Algorithms 1

Work Analysis – Pointer Jumping Number of Steps: Tp = O(Log N) Number of Processors: N Work = O(N log N) T1 = O(N) Work Optimal?? 2

Common List Ranking Strategy Reduce Rank Expand Strategy Similar to Odd-Even Prefix Sums Algorithms vary in how items are selected for deletion in the Reduce Step Some variation in the Expand Step. 3

Reduce Rank Expand Reduction Step - Delete non-adjacent elements in parallel until the list is of size O(p) (algorithms vary is this step) Rank Step – Pointer jumping to rank the p remaining elements Expand Step – Reinsert elements (in the reverse order), computing the rank as it is inserted 4

Asynchronous PRAM – APRAM Variant of the PRAM model Features of CRCW PRAM – Plus Processors may have different clock speeds and work asynchronously Each processor has own random number generator 5

Randomized Algorithm Some portion of the algorithms outcome is non-deterministic Performance stated in terms of expected order of time complexity – EO(f(n)) EO(f(n)) – with high probability the results are within order f(n) 6

APRAM List Ranking by Martel & Subramonian 1.Select m=EO(n/log n) elements at random 1.Each generates a random number between 1-N, selects those with values 1 to N / log N 2.Perform log log n iterations of pointer jumping 1.Each points to selected, nil, or pointer length log n 3.Pack selected elements to smaller array 4.Scan: each selected points to next selected or nil 5.Compute ranks of selected list-pointer jumping 6.Copy back to original list; scan to complete ranks *EO(n log log n) using p = O(n/log n) 7

List Rank Step1 R# Sel ***** Step2 List Rank Step3 Rank Step4 Rank Demo: APRAM Randomized Algorithm 8

Modifications for EREW Model APRAM Each PU operates asynchronously Must synchronize each at step Steps 2, 4, 6 allow for Concurrent Reads EREW Default execution is synchronous Partition the array to eliminate Concurrent Reads 9

Randomized EREW Algorithm (4.1) Select O(p) elements at random Each generates a random number between 1-N, selects those with values 1 to N / log N Pack selected items into smaller array Scan from selected item to next to set rank Rank selected elements by pointer jumping Write ranks back to original array Scan from selected items to set remaining ranks 10

List Rank Step1 R# Sel ***** Stp2 List Rank Stp3 Rank Stp4 Rank Demo: EREW Randomized Algorithm 11

Complexity Analysis Selection - EO(n/p) Compaction - prefix sums EO(n/p + log p) Form LL - EO(n/p) Pointer Jumping - EO ( n/p + log p) Sequential Scan - EO(n/p) OVERALL - EO ( n/p + log p) Optimal speedup for p <= O (n / log n) Which gives EO ( log n) time See paper for proof. 12

What next?? Can we accomplish an O(log n) deterministic algorithm? What was randomized in other algorithms? Can it be made deterministic? 13

Answer! Yes & No, Can Reduce deterministically! Near Optimal 2-Ruling Set (Cole & Vishkin) A subset of the list such that no 2 elements are adjacent & there are exactly 1 or 2 non-ruling set elements between each ruling set element & its nearest successor 14

Deterministic EREW LLR Step 1 Select a Ruling Set of O(p) elements, O(n/p) distance apart Keep track of actual distance (for ranking) Repeatedly apply 2-Ruling Set Algorithm to increase the distance between the elements Remaining steps are same 15

Complexity Analysis 1.Select O(p) elements O(n/p) distance apart – O(n/p * log (n/p)) 2.Compact – O(n/p + log p) 3.Rank – O(n/p + log p) 4.Write back then Scan – O(n/p) O((log p) + (n/p) * log(n/p)) = O(n/p * log (n/p) ) for n>= p log p = O(log n log log n) for p =O(n/log n) Work O(n log log n) 16

17

Advantages of New Algorithms Simple, use basic strategies Small constants Small space requirements Optimal & Near Optimal 18