Termination Detection

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Messages Complexity Evaluation For Dijkstra-Scholton and Shavit-Francez Termination Detection Algorithms Kovan A. Mohammed Ali Advanced Operating System.
Global States.
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.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Lecture 8: Asynchronous Network Algorithms
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
1 CS 194: Elections, Exclusion and Transactions Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
6. Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
CS 484. Discrete Optimization Problems A discrete optimization problem can be expressed as (S, f) S is the set of all feasible solutions f is the cost.
6.852: Distributed Algorithms Spring, 2008 Class 12.
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
Self Stabilizing Algorithms for Topology Management Presentation: Deniz Çokuslu.
Termination Detection of Diffusing Computations Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003.
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Logical Clocks and Global State.
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.
1 Complexity of Network Synchronization Raeda Naamnieh.
CS514: Intermediate Course in Operating Systems Professor Ken Birman Vivek Vishnumurthy: TA.
CS 582 / CMPE 481 Distributed Systems
Ordering and Consistent Cuts Presented By Biswanath Panda.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Distributed Algorithms Broadcast and spanning tree.
Chapter 4 - Self-Stabilizing Algorithms for Model Conservation4-1 Chapter 4: roadmap 4.1 Token Passing: Converting a Central Daemon to read/write 4.2 Data-Link.
LSRP: Local Stabilization in Shortest Path Routing Hongwei Zhang and Anish Arora Presented by Aviv Zohar.
Slides for Chapter 10: Time and Global State
Chapter 11 Detecting Termination and Deadlocks. Motivation – Diffusing computation Started by a special process, the environment environment sends messages.
The Byzantine Generals Strike Again Danny Dolev. Introduction We’ll build on the LSP presentation. Prove a necessary and sufficient condition on the network.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
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.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 10 Instructor: Haifeng YU.
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
MUTUAL EXCLUSION AND QUORUMS CS Distributed Mutual Exclusion Given a set of processes and a single resource, develop a protocol to ensure exclusive.
DISTRIBUTED ALGORITHMS By Nancy.A.Lynch Chapter 18 LOGICAL TIME By Sudha Elavarti.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
Teacher: Chun-Yuan Lin
A correction The definition of knot in page 147 is not correct. The correct definition is: A knot in a directed graph is a subgraph with the property that.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
Distributed Snapshot. One-dollar bank Let a $1 coin circulate in a network of a million banks. How can someone count the total $ in circulation? If not.
M. Veeraraghavan (originals by J. Liebeherr) 1 Need for Routing in Ethernet switched networks What do bridges do if some LANs are reachable only in multiple.
Ad-hoc On Demand Distance Vector Protocol Hassan Gobjuka.
Chapter 21 Asynchronous Network Computing with Process Failures By Sindhu Karthikeyan.
1 Review Questions Define n variables, types of shared variables, message-passing, shared-memory system, system topology n program-counter/guarded command.
Dijkstra-Scholten and Shavit-Francez termination algorithms
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Hwajung Lee. Some applications - computing network topology - termination detection - deadlock detection Chandy Lamport algorithm does a partial job.
1 Chapter 11 Global Properties (Distributed Termination)
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
CSE 486/586 CSE 486/586 Distributed Systems Leader Election Steve Ko Computer Sciences and Engineering University at Buffalo.
Parallel and Distributed Simulation Deadlock Detection & Recovery.
Distributed Systems Lecture 9 Leader election 1. Previous lecture Middleware RPC and RMI – Marshalling 2.
Distributed Systems Lecture 6 Global states and snapshots 1.
Termination detection
Theoretical Foundations
CS60002: Distributed Systems
Lecture 9: Asynchronous Network Algorithms
ITEC452 Distributed Computing Lecture 9 Global State Collection
Global state collection
CSE 486/586 Distributed Systems Leader Election
Distributed Snapshot Distributed Systems.
Dijkstra-Scholten and Shavit-Francez termination algorithms
Jenhui Chen Office number:
CIS825 Lecture 5 1.
By:- Rizwan Malik For Advanced OS Course 2007
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Termination Detection 4/24/2017 Termination Detection definition motivation for termination detection main concepts in termination termination announcement termination detection Dijkstra-Scholten termination detection for diffusing comptuations Shavit-Francez generalization wave-based snapshot and weight-throwing-based

Definitions terminal state (fixpoint) – no actions enabled 4/24/2017 Definitions terminal state (fixpoint) – no actions enabled terminal state of process – a special local state of a process where no event of the process is applicable deadlock is an example of terminal state termination implicit (message termination) - state that allows the receipt of messages but there are no messages in the channels - no action can be executed but the processes are not aware of termination explicit (process termination) - a terminal state with every process in terminal state and no messages in channels implicit termination is easier to design since the processes do not need to know the algorithm terminated

Why Termination Detection 4/24/2017 Why Termination Detection objective - convert message terminating algorithms into process terminating. achieved by adding two additional algorithms. The original algorithm is called basic algorithm. The added algorithms perform two tasks: termination detection – recognize that the basic algorithm is in message terminating state termination announcement – makes all processes go into designated terminating state the added algorithms may exchange messages. They are called control messages

4/24/2017 More Definitions event can be internal or external (receipt of message) each basic process is assumed to be in one of two states: active - an action of the process is enabled (able to execute) passive - no process actions are enabled variable statep represents whether process is active or passive the following assumptions about basic algorithms: active process becomes passive only on internal event process always becomes active when a message is received internal events where process becomes passive are the only internal events (we ignore active  active events) diffusing computation (centralized algorithm)- algorithm where only one process is active in every initial state this process is called initiator

Termination Announcement 4/24/2017 Termination Announcement To announce termination stop control message is flooded to all processes each process sends stop message to every neighbor messages are sent at most once: on local call to Announce on receiving the first stop the algorithm terminates when it receives stop from every neighbor the algorithm works on directed and undirected networks, requires no identities, leader or topological knowledge what does this algorithm resemble? what happens when multiple nodes call announce simultaneously? the algorithm resembles a wave on tree apparently it works just fine with multiple simultaneous announcements

Dijkstra-Scholten Termination Detection 4/24/2017 Dijkstra-Scholten Termination Detection The algorithm works on diffusing computations only, p0 is initiator the algorithm dynamically maintains a computation tree T=(VT,ET) Either T is empty, or T is a directed tree with root p0 VT includes all active processes and all basic messages in transit initiator calls Announce when p0 VT (which implies that T is empty) when process p sends basic message mes it becomes the father of this message when mes is received by q if q is involved in computation (does not have a father) it set p to be its father q has a father it sends message sig back to p each process p maintains variable scp that counts the number of sons every time p sends mes, scp is incremented every time p receives sig it is decremented when scp is 0 and p is passive, it sends sig to its parent

Termi-nation detection 4/24/2017 Sp - basic send Rp - basic receive Ip - change from active to passive Ap - arrival of signal

Shavit-Francez Generalization to the Decentralized Algorithm 4/24/2017 Shavit-Francez Generalization to the Decentralized Algorithm Dijkstra-Scholten algorithm works only on diffusing computations (one initiator) Shavit-Francez suggested generalization to decentralized algorithms (multiple initiators) in their algorithm each initiator maintains a computation tree similar to Dijkstra- Scholten problem - when the tree on one initiator collapsed the initiator does not know if the computation terminated - there still may be other trees solution - all processes participate in a wave non-initiator process continues the wave initiator process continues the wave only if its tree has collapsed by definition of wave a process decides only when all system processes made at least one move. Thus when one process decides the basic computation terminates. when process decides - it calls Announce

Wave-Based Termination 4/24/2017 Wave-Based Termination idea: each process counts number of messages sent/received run a wave, subtract received from sent, if total is 0 and all processes are passive -> detect termination problem: contamination

Using Timestamps to Track Messages 4/24/2017 Using Timestamps to Track Messages timestamp each basic message, wave is invalid when timestamp of basic message is greater than timestamp of the wave if wave invalid – start another one

Termination Detection Using Snapshots and Weight Throwing 4/24/2017 Termination Detection Using Snapshots and Weight Throwing snapshots when process becomes passive it initiates a snapshot if an active process receives a snapshot message, it ignores it eventually, a snapshot succeeds, if this snapshot does not have messages in transition  detect termination if a snapshot succeeds, does it mean that the basic alg. terminated? weight throwing each active process starts with a certain quantity (weight). The sum of all weights is 1. when a process sends a message it sends part of its weight with it, when message arrives, the process adds the message’s weight to its own when a process becomes passive, it sends its weight to initiator when initiator’s weight is equal to 1, detect termination if a snapshot succeeds, does it mean that the program terminated? no, all processes may be passive, yet there may be a message in transition that will make a process active again