Case Study 2- Parallel Breadth-First Search Using OpenMP

Slides:



Advertisements
Similar presentations
Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
Advertisements

Introduction to Algorithms Lecture 12 Prof. Constantinos Daskalakis CLRS
CSE 390B: Graph Algorithms Based on CSE 373 slides by Jessica Miller, Ruth Anderson 1.
CSC 421: Algorithm Design & Analysis
Alyce Brady CS 510: Computer Algorithms Breadth-First Graph Traversal Algorithm.
Shortest path algorithm. Introduction 4 The graphs we have seen so far have edges that are unweighted. 4 Many graph situations involve weighted edges.
Alyce Brady CS 510: Computer Algorithms Depth-First Graph Traversal Algorithm.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Distance Approximating Trees in Graphs
Representing and Using Graphs
Bill Payment Optimization Algorithms. Purpose To find and/or construct algorithms that will optimize the decision process of paying bills from an account.
Implementing Parallel Graph Algorithms: Graph coloring Created by: Avdeev Alex, Blakey Paul.
All-Pairs Shortest Paths & Essential Subgraph 01/25/2005 Jinil Han.
Representing Graphs Depth First Search Breadth First Search Graph Searching Algorithms.
Graphs A New Data Structure
Graphs – Breadth First Search
Graphs Chapter 15 introduces graphs which are probably the most general and commonly-used data structure. This lecture introduces heaps, which are used.
Data Structures Graphs - Terminology
Graphs Representation, BFS, DFS
CSC 421: Algorithm Design & Analysis
CSC 421: Algorithm Design & Analysis
CS 1114: Implementing Search
CSE373: Data Structures & Algorithms Lecture 13: Topological Sort / Graph Traversals Kevin Quinn Fall 2015.
Faster Data Structures in Transactional Memory using Three Paths
CSE 2331/5331 Topic 9: Basic Graph Alg.
Csc 2720 Instructor: Zhuojun Duan
Cse 373 May 8th – Dijkstras.
CSC 421: Algorithm Design & Analysis
Cse 373 May 15th – Iterators.
Spare Register Aware Prefetching for Graph Algorithms on GPUs
Chapter 5.
Unweighted Shortest Path Neil Tang 3/11/2010
Solving Linear Systems by Linear Combinations
Finding Heuristics Using Abstraction
CMSC 341 Lecture 21 Graphs (Introduction)
Localizing the Delaunay Triangulation and its Parallel Implementation
CSE 421: Introduction to Algorithms
Graphs Representation, BFS, DFS
Data Structures – Stacks and Queus
Lesson Objectives Aims You should be able to:
Graphs Chapter 15 explain graph-based algorithms Graph definitions
"Learning how to learn is life's most important skill. " - Tony Buzan
Graphs Chapter 11 Objectives Upon completion you will be able to:
Degree-aware Hybrid Graph Traversal on FPGA-HMC Platform
Can you get there from here?
Chapter 22: Elementary Graph Algorithms I
Lectures on Graph Algorithms: searching, testing and sorting
Outline This topic covers Prim’s algorithm:
On the effect of randomness on planted 3-coloring models
Parallel Computation Patterns (Reduction)
Lecture 13 CSE 331 Sep 27, 2017.
Peng Jiang, Linchuan Chen, and Gagan Agrawal
CSE 421: Introduction to Algorithms
Chapter 14 Graphs © 2006 Pearson Addison-Wesley. All rights reserved.
CSE 373: Data Structures and Algorithms
Solving Linear Systems by Linear Combinations (Elimination)
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
CSC 421: Algorithm Design & Analysis
Graph Algorithms "A charlatan makes obscure what is clear; a thinker makes clear what is obscure. " - Hugh Kingsmill CLRS, Sections 22.2 – 22.4.
Graph Traversal Lecture 18 CS 2110 — Spring 2019.
Algorithms Lecture # 27 Dr. Sohail Aslam.
Graphs.
Programming with Shared Memory Specifying parallelism
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Unit 2: Computational Thinking, Algorithms & Programming
Analysis and design of algorithm
Lecture 10 Graph Algorithms
CSC 421: Algorithm Design & Analysis
Algorithms CSCI 235, Spring 2019 Lecture 32 Graphs I
Search Strategies CMPT 420 / CMPG 720.
Presentation transcript:

Case Study 2- Parallel Breadth-First Search Using OpenMP PARALLEL PROGRAM DEVELOPMENT Case Study 2- Parallel Breadth-First Search Using OpenMP

Breadth-first search (BFS) is a common algorithm that you've almost certainly seen in a prior algorithms class. In this problem, you'll explore the challenges of parallelizing BFS on modern parallel machines. Please familiarize yourself with the function bfs_top_down() in bfs.cpp, which contains a sequential implementation of BFS. The code uses BFS to compute the distance to vertex 0 for all vertices in the graph. You may wish to familiarize yourself with the graph structure defined in graph.h as well as the simple array data structure vertex_set which is an array of vertices used to represent the current frontier of BFS.

Step 1 Please parallelize the top-down BFS. You'll need to focus on identifying parallelism, as well as inserting the appropriate synchronization to ensure correctness. We'll point out up front that you should not expect to achieve near-perfect speedups on this problem (we'll leave it to you to think about why!). A good solution in step 1 will perform approximately three times faster than the sequential starter code when using 12 threads on the six-core (but hyper-threaded) GHC machines when run on the larger random graphs.

Step 2 If you take a look at the step-by-step results of the top-down BFS, you'll notice that the frontier grows quite large in some steps (sometimes growing to contain a large fraction of the entire graph). This is particularly true in the rmat graphs. Think about why this behavior might cause a performance problem in the top-down BFS implementation from step 1. It suggests an alternative implementation of a breadth-first search step that may be more efficient in these situations. Instead of iterating over all vertices in the frontier and marking all vertices adjacent to the frontier, it is possible to implement BFS by having each vertex check whether it should be added to the frontier! Basic pseudocode for the algorithm is as follows: for each vertex v in graph: if v has not been visited AND v shares an incoming edge with a vertex on the frontier: add vertex v to frontier;

Step 3 Now that you have implemented both top-down and bottom-up parallel BFS implementations, combine the techniques to form a new hybrid algorithm that performs a faster parallel BFS than either of the two techniques alone. This hybrid approach is called a "Direction Optimization BFS".