Wave and Traversal Algorithms

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

CS 542: Topics in Distributed Systems Diganta Goswami.
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Lecture 8: Asynchronous Network Algorithms
CS542 Topics in Distributed Systems Diganta Goswami.
OSU CIS Lazy Snapshots Nigamanth Sridhar and Paul A.G. Sivilotti Computer and Information Science The Ohio State University
Termination Detection. Goal Study the development of a protocol for termination detection with the help of invariants.
Termination Detection Part 1. Goal Study the development of a protocol for termination detection with the help of invariants.
Global State Collection. Global state collection Some applications - computing network topology - termination detection - deadlock detection Chandy-Lamport.
Distributed Snapshot (continued)
CS 582 / CMPE 481 Distributed Systems
Alyce Brady CS 510: Computer Algorithms Depth-First Graph Traversal Algorithm.
Raeda Naamnieh 1. The Partition Algorithm Intuitively, the idea of the following algorithm is to choose each cluster as a maximal subset of nodes whose.
Introduction to computer networking Distributed Algorithms Class Recitation.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Broadcast & Convergecast Downcast & Upcast
DISTRIBUTED ALGORITHMS By Nancy.A.Lynch Chapter 18 LOGICAL TIME By Sudha Elavarti.
Distributed Snapshot. Think about these -- How many messages are in transit on the internet? --What is the global state of a distributed system of N processes?
Termination Detection
Teacher: Chun-Yuan Lin
Tarry vs Awerbuchs Shawn Biesan. Background Tarry’s Transversal Algorithm – Initiator forwards token to one of neighbors, each neighbor forwards token.
Comparison of Tarry’s Algorithm and Awerbuch’s Algorithm Mike Yuan CS 6/73201 Advanced Operating Systems Fall 2007 Dr. Nesterenko.
Hwajung Lee. Well, you need to capture the notions of atomicity, non-determinism, fairness etc. These concepts are not built into languages like JAVA,
Hwajung Lee. Why do we need these? Don’t we already know a lot about programming? Well, you need to capture the notions of atomicity, non-determinism,
Hwajung Lee. -- How many messages are in transit on the internet? --What is the global state of a distributed system of N processes? How do we compute.
Comparison of Tarry’s Algorithm and Awerbuch’s Algorithm CS 6/73201 Advanced Operating System Presentation by: Sanjitkumar Patel.
Global State Collection
1 Review Questions Define n variables, types of shared variables, message-passing, shared-memory system, system topology n program-counter/guarded command.
1 Chapter 11 Global Properties (Distributed Termination)
Efficient Algorithms for Distributed Snapshots and Global Virtual Time Approximation Author: Friedermann Mattern Presented By: Shruthi Koundinya.
Token-passing Algorithms Suzuki-Kasami algorithm The Main idea Completely connected network of processes There is one token in the network. The holder.
CIS 825 Lecture 9. Minimum Spanning tree construction Each node is a subtree/fragment by itself. Select the minimum outgoing edge of the fragment Send.
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
Fundamentals of Fault-Tolerant Distributed Computing In Asynchronous Environments Paper by Felix C. Gartner Graeme Coakley COEN 317 November 23, 2003.
Distributed Systems Lecture 6 Global states and snapshots 1.
1 Traversal Algorithms  sequential polling algorithm  traversing connected networks (tree construction) complexity measures tree terminology tarry’s.
Process Management Deadlocks.
Termination detection
Graph Traversals Some algorithms require that every vertex of a graph be visited exactly once. The order in which the vertices are visited may be important,
Model and complexity Many measures Space complexity Time complexity
Consistent cut A cut is a set of events.
Distributed Mutual Exclusion
CS60002: Distributed Systems
Lecture 9: Asynchronous Network Algorithms
Distributed Snapshot.
Agreement Protocols CS60002: Distributed Systems
Tree Construction (BFS, DFS, MST) Chapter 5
CS60002: Distributed Systems
Leader Election CS60002: Distributed Systems
Distributed Snapshot.
Distributed Deadlock Detection
Elementary Graph Algorithms
CS60002: Distributed Systems
The Balanced Sliding Window Protocol
Depth-First Search Graph Traversals Depth-First Search DFS.
Global State Collection
Non-Distributed Excercises
Distributed Snapshot Distributed Systems.
Copyright © Aiman Hanna All rights reserved
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
ITEC452 Distributed Computing Lecture 8 Distributed Snapshot
Distributed Mutual Exclusion
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Distributed Snapshot.
Distributed algorithms
CIS825 Lecture 5 1.
CS60002: Distributed Systems
Distributed systems Consensus
Consistent cut If this is not true, then the cut is inconsistent
Distributed Snapshot.
Presentation transcript:

Wave and Traversal Algorithms CS60002: Distributed Systems INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Wave Algorithms A wave algorithm is a distributed algorithm that satisfies the following three requirements: Termination: Each computation is finite Decision: Each computation contains at least one decide event Dependence: In each computation each decide event is causally preceded by an event in each process INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

The Echo Algorithm – a wave algorithm var recp : integer init 0; // Counts no of recvd mesgs fatherp : process init udef; For the initiator begin forall q  Neighp do send  tok  to q ; while recp < #Neighp do begin receive  tok  ; recp = recp + 1 end ; decide end For non-initiators begin receive  tok  from neighbor q ; fatherp = q ; recp = recp + 1 ; forall q  Neighp, q  fatherp do send  tok  to q ; send  tok  to fatherp INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Traversal Algorithms A traversal algorithm is an algorithm with the following three properties: In each computation there is one initiator, which starts the algorithm by sending out exactly one message A process, upon receipt of a message, either sends out one message or decides The algorithm terminates in the initiator and when this happens, each process has sent a message at least once INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Sequential Polling – a traversal algorithm var recp : integer init 0; // For initiator only For the initiator begin while recp < #Neighp do begin send  tok  to qrecp + 1 ; receive  tok  ; recp = recp + 1 end ; decide end For non-initiators begin receive  tok  from q ; send  tok  to q ; end INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Classical Depth-first Search var usedp[q] : boolean init false for each q  Neighp ; fatherp : process init udef ; // For the initiator only – execute once begin fatherp = p ; choose q  Neighp ; usedp[q] = true ; send  tok  to q ; end INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Classical Depth-first Search contd.. // For each process, upon receipt of  tok  from q0: begin if fatherp = udef then fatherp = q0 ; if q  Neighp: usedp[q] then decide else if q  Neighp: (q  fatherp  usedp[q]) then begin if fatherp  q0  usedp[q0] then q = q0 else choose q  Neighp \ { fatherp } with usedp[q] ; usedp[q] = true ; send  tok  to q end else begin usedp[ fatherp ] = true ; send  tok  to fatherp INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Classical Depth-first Search Algorithm The classical depth-first search algorithm computes a depth-first search spanning tree using 2|E| messages and 2|E| time units INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Awerbuch’s DFS Algorithm Prevents the transmission of the token through a frond edge When process p is first visited by the token p informs each neighbor r, except its father, of the visit by sending a vis message to r The forwarding of the token is suspended until p has received an ack message from each neighbor When later, the token arrives at r, r will not forward the token to p, unless p is r’s father Awerbuch’s algorithm computes a depth-first search tree in 4N – 2 time units and uses 4.|E| messages INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Cidon’s DFS Algorithm The token is forwarded immediately The following situation is important: Process p has been visited by the token and has sent a vis message to its neighbor r The token reaches r before the vis message from p In this case r may forward the token to p along a frond edge The situation is handled as follows: Process p records to which neighbor it most recently sent the token – normally it expects to get it back from the same If it gets it back from some other neighbor it ignores the token, but marks the edge rp as used, as if it received a vis message from p When r eventually receives the vis message from p it behaves as if it never had sent the token to p Cidon’s algorithm computes a DFS tree in 2N – 2 time units and uses 4.|E| messages INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR