Global state collection - PowerPoint PPT Presentation

About This Presentation
Title:

Global state collection

Description:

... Lamport algorithm does a partial job. Each process generates a fragment of the global state, but these ... Once the pieces of a consistent global state become ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 11
Provided by: Sukuma7
Category:

less

Transcript and Presenter's Notes

Title: Global state collection


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
A simple exercise
  • 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

s(i)
s(j)
i
j
s(k)
s(l)
k
l
3
All-to-all broadcast
Assume that the topology is a strongly connected
graph
  • Program broadcast (for process i
  • define V.i, W.i set of values
  • initially V.is(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

V.i W.i
V.k W.k
(i,k)
(j,i)
V.j W.j
Acts like a pump
4
Proof outline
  • 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

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
Dijkstra-Scholten algorithm
The basic scheme
  • Node j engages node k.
  • 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.

j
k
signal
j
k
j
k
ack
8
Dijkstra-Scholten algorithm
  • 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 gt 0) ? (D 0)

0
1
2
3
4
5
9
Dijkstra-Scholten algorithm
  • The invariants must hold when
  • an interim node sends an ack.
  • So, acks will be sent when
  • (C-1 0) ? (C-1 gt 0 ??D0)
  • follows from INV1 and INV2
  • (C gt 1) ?? (C 1 ? D0)
  • (C gt 1) ??(C 1 ? D0)

0
1
2
3
4
5
10
Dijkstra-Scholten algorithm
0
  • program detect for an internal node i
  • initially C0, D0, parent i
  • do m signal ? (C0) ?
  • C1 state active parent sender
  • Send signals to engage other nodes if
    necessary, or turn passive
  • m ack ? D D-1
  • (C1? D0) ? state passive ?
  • send ack to parent C 0 parent i
  • m signal ? (C1) ?
  • send ack to the sender
  • od

1
2
3
4
5
Note that the engaged nodes induce a spanning tree
Write a Comment
User Comments (0)
About PowerShow.com