1 / 10

Global state collection

Global state collection. Some applications - computing network topology - termination detection - deadlock detection

austin
Download Presentation

Global state collection

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. Global state collection Some applications - computing network topology - termination detection - deadlock detection Chandy Lamport algorithm does a partial job. Each process generates a fragment of the global state, but these pieces have to be stitched together to form a global state.

  2. Once the pieces of a consistent global state become available, consider collecting the global state via all-to-all broadcast At the end, each process will compute a set V, where V= {s(i): 0 ≤ i ≤ N-1 } A simple exercise s(i) s(j) i j s(k) s(l) k l

  3. Program broadcast (for process i} define V.i, W.i : set of values; initially V.i={s(i)}, W.i =  andevery channel is empty do V.i ≠ W.i send (V.i \ W.i) to every outgoing channel; W.i := V.i j: ¬ empty (j, i) receive X from channel(j, i); V.i := V.i  X od All-to-all broadcast Assume that the topology is a strongly connected graph V.i W.i V.k W.k (i,k) (j,i) V.j W.j Acts like a “pump”

  4. Lemma. empty (i. k) W.i V.k. (Why?) Lemma. The algorithm will terminate in a bounded number of steps. (Why?) (Upon termination) i: V.i = W.i, and all channels are empty. So, V.i  V.k. On a cyclic path, V.i = V.k must be true. Since s(i)V.i, s(i)V.k Proof outline V.i W.i V.k W.k (i,k)

  5. Termination detection During the progress of a distributed computation, processes may periodically turn active or passive. A distributed computation termination when: (a) every process is passive, (b) all channels are empty, and (c) the global state satisfies the desired postcondition

  6. Visualizing diffusing computation initiator active passive Notice how one process engages another process. Eventually all processes turn white, and no message is in transit -this signals termination. How to develop a signaling mechanism to detect termination?

  7. An initiator initiates termination detection by sending signals (messages) down the edges via which it engages other nodes. At a “suitable time,” the recipient sends an ack back. When the initiator receives ack from every node that it engaged, it detects termination. Node j engages node k. Dijkstra-Scholten algorithm The basic scheme j k signal j k j k ack

  8. Deficit (e) = # of signals on edge e - # of ack on edge e For any node, C = total deficit along incoming edges and D = total deficit along outgoing edges edges For the initiator, by definition, C = 0 Dijkstra-Scholten algorithm used the following two invariants to develop their algorithm: Invariant 1. (C ≥ 0)  (D ≥ 0) Invariant 2. (C > 0)  (D = 0) Dijkstra-Scholten algorithm 0 1 2 3 4 5

  9. The invariants must hold when an interim node sends an ack. So, acks will be sent when (C-1 ≥ 0)  (C-1 > 0 D=0) {follows from INV1 and INV2} = (C > 1)  (C ≥1  D=0) = (C > 1) (C =1  D=0) Dijkstra-Scholten algorithm 0 1 2 3 4 5

  10. program detect {for an internal node i} initially C=0, D=0, parent = i do m = signal  (C=0)  C:=1; state:= active; parent := sender {Send signals to engage other nodes if necessary, or turn passive} m = ack  D:= D-1 (C=1 D=0)  state = passive  send ack to parent; C:= 0; parent := i m = signal  (C=1) send ackto the sender; od Dijkstra-Scholten algorithm 0 1 2 3 4 5 Note that the engaged nodes induce a spanning tree

More Related