1 / 22

Termination Detection of Diffusing Computations

Termination Detection of Diffusing Computations. Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003. Motivation. We would like to simplify programming of asynchronous networks Use a monitoring algorithm Debugging Backup Termination detection

cicily
Download Presentation

Termination Detection of Diffusing Computations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. 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 Send/Receive Model 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 Ai at node ni receives an input event, • andafter some time a global quiescent state is reached, • then a special donei 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. A2 A1 A4 A3 Example

  14. Dijkstra-Scholten Automaton (1) • Signature of DS(Ai) • Signature of Ai • Input • Receive(“ack”)j,I where j  nbrs • Output • Send(“ack”)i,j where j  nbrs • Internal • Cleanupi • Donei

  15. Dijkstra-Scholten Automaton (2) • State information for DS(Ai) • All state info for diffusing computation Ai • si {idle, root, non-root}, initially idle • pi  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, • si {root, idle} and pi = null • j≠i, sj{idle, non-root}, and if sj=non-root, then pj = null • j, if sj=idle then the projected state of Aj is quiescent, pj=null, and deficit(k)j=0 for every k • j,k, deficit(k)j = numMsgsj,k + numBufAcksj,k + numAcksj,k + {1 if pk = j, 0 otherwise} • If si = root, then the parent pointers form a directed tree rooted at i which spans the set of nodes with s ≠ idle • If si = idle, then sj = 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 pk = 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. 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

More Related