Presentation is loading. Please wait.

Presentation is loading. Please wait.

Termination Detection of Diffusing Computations Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003.

Similar presentations


Presentation on theme: "Termination Detection of Diffusing Computations Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003."— Presentation transcript:

1 Termination Detection of Diffusing Computations Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003

2 Motivation We would like to simplify programming of asynchronous networks  Use a monitoring algorithm Debugging Backup Termination detection Deadlock detection Global quantity computation

3 Approaches Stable property detection  Any property of the global state that, once established, remains true  E.g., deadlock or termination Consistent global snapshots  Captures the global state of the network such that it appears to all processes to have been taken at the same instant on every process

4 Asynchronous Networks Collection of processes Collection of channels Communication subsystem  Point-to-point  Broadcast  Multicast

5 Network Model n-Node directed graph  G=(V,E) Represent n processes as nodes in graph Represent channels as directed edges in graph

6 Send/Receive Model Processes  Input actions Receive(m) i,j  Output actions Send(m) i,j Channels  Input actions Send(m) i,j  Output actions Receive(m) i,j Each process associated with a node and each channel associated with an edge in the graph G is modeled as an I/O automaton

7 Termination Detection for Diffusing Computations All processes are initially quiescent A designated “live” process diffuses computation to other processes Processes awaken, perform work, spread computation Processes become quiescent again When all processes become quiescent, then termination should be signaled

8 Problem Statement (1) Initially  No locally controlled actions can be performed  All channels are empty A single process is awakened with an input event from the environment  It can perform an output action to generate an event, send, for other processes A process performs an input action, receive, which wakes up the process Awakened processes perform tasks and spread computation with output actions A process becomes quiescent again when  No locally controlled action can be performed;  No messages exist in its channel

9 Problem Statement (2) Given the initial state of the network as described, If a process A i at node n i receives an input event, and after some time a global quiescent state is reached, then a special done i output should be performed at node i

10 Detecting Termination Detect termination of algorithm A with a monitoring algorithm, B(A)  Send/receive algorithm  Based on the graph G  Issues a special done output when termination is detected

11 Dijkstra-Scholten Algorithm(1) Basic idea:  Augment the diffusing algorithm with construction and maintenance of a spanning tree  Tree is rooted at the source node of the diffusing computation  Tree includes all active nodes  Tree grows/shrinks as nodes become active/idle

12 Dijkstra-Scholten Algorithm(2) All nodes are initially idle A single node, the source of the diffusing computation, becomes active An idle node receives a message from the diffusing computation algorithm, A  Becomes active  Records the sender as its parent  Does not ack the message until ready to become idle again An active node must wait for all outgoing messages to be acknowledged before becoming idle again

13 Example A1A1 A4A4 A3A3 A2A2

14 Dijkstra-Scholten Automaton (1) Signature of DS(A i )  Signature of A i  Input Receive(“ack”) j,I where j  nbrs  Output Send(“ack”) i,j where j  nbrs  Internal Cleanup i Done i

15 Dijkstra-Scholten Automaton (2) State information for DS(A i )  All state info for diffusing computation A i  s i  {idle, root, non-root}, initially idle  p i  nbrs  {null}, initially null   j  nbrs: send-buffer(j), a FIFO queue of ack msgs, initially empty deficit(j)  N, initially 0

16 Dijkstra-Scholten Automaton (3) Transitions  See handout

17 Lemma In any state after an input at node i,  s i  {root, idle} and p i = null   j≠i, s j  {idle, non-root}, and if s j =non-root, then p j = null   j, if s j =idle then the projected state of A j is quiescent, p j =null, and deficit(k) j =0 for every k   j,k, deficit(k) j = numMsgs j,k + numBufAcks j,k + numAcks j,k + {1 if p k = j, 0 otherwise}  If s i = root, then the parent pointers form a directed tree rooted at i which spans the set of nodes with s ≠ idle  If s i = idle, then s j = idle for all j and all channels are empty

18 Proof Outline (1) The Dijkstra-Scholten algorithm detects termination for a diffusing algorithm A  Lemma implies that if root announces termination, then A is quiescent  Must show liveness property If A becomes quiescent, then the root eventually announces termination

19 Proof Outline (2) Proof by contradiction:  Assume that A becomes quiescent and no done event occurs  After this point, no A messages are sent or received again The tree cannot grow The tree must eventually stop shrinking Eventually, there are no further ack messages in the global state

20 Proof Outline (3)  j,k, deficit(k) j = 0 + 0 + 0 + {1 if p k = j, 0 otherwise } This means that the cleanup action is enabled  The tree can shrink further -- Contradiction

21 Complexity Analysis Messages  2m, where m is the number of messages sent by the algorithm A Time  O(m(l+d)) l is an upper bound on time associated with a process performing a task d is an upper bound on time associated with a channel to perform a task

22 Consistent Global Snapshots

23 CSG Problem Statement

24 Chandy-Lamport Algorithm

25 Example

26 Proof Outline

27 CSG Applications

28 Conclusions Use a monitoring algorithm to detect termination of a computation Use a spanning tree to track nodes participating in the computation Use acks and message counters to maintain tree


Download ppt "Termination Detection of Diffusing Computations Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003."

Similar presentations


Ads by Google