1 / 28

Termination Detection

Termination Detection. Presented by: Yonni Edelist. The model. A finite graph of machines (nodes) and communication channels (edges), in which a distributed computation is taking place Machines can be either ‘ active ’ or ‘ passive ’ Only active machines may send messages

glenda
Download Presentation

Termination Detection

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 Presented by: Yonni Edelist

  2. The model • A finite graph of machines (nodes) and communication channels (edges), in which a distributed computation is taking place • Machines can be either ‘active’ or ‘passive’ • Only active machines may send messages • Passive machine may become active only when it receives a message • Active machine may become passive at any time

  3. The model- example 0 2 3 1 6 5 4

  4. The problem • If, in the computation, a finite number of messages are sent, the graph will reach a stable state in which no more messages are sent • One machine, say machine no. 0, wants to detect that the graph has reached that state • We will build an algorithm which enables machine 0 to detect termination

  5. example • We denote messages sent by the termination detection algorithm ‘signals’ 0 2 3 1 6 5 4

  6. Termination detection in a ring

  7. The model • N machines, 0..N-1 • Machine 0 initiates the detection algorithm • Does so by sending a signal (a token) to machine 1 • Machine i can propagate the token to machine i+1 • We denote the machine currently holding the token ‘t’

  8. System Invariant • We describe an invariant, which will be true for every configuration of the system (for every value of t) • Machine 0 will know that all other machines are passive based on: • t=0 • The invariant • (possibly) further information available at machine 0

  9. First Invariant- P0 • First step- we assume that there are no messages • Meaning: an active node may become passive, but not vice-versa • P0: (∀ i: 0≤i<t machine i is passive)

  10. P0- Example 0 3 1 2 Red outline represents an active machine

  11. Rule 0 • In order to preserve the invariant, we must follow the rule: • Rule 0: Machine i transmits the token only if it’s passive • (remember that a passive machine can’t become active again)

  12. Rule 0- Example 0 3 1 2

  13. But what if a message is sent? 0 3 1 2

  14. Invariant P1 • If machine i<t receives a message, it becomes active, thus falsifying P0 • Message must have been sent by machine j≥t • P1 is established whenever P0 is falsified in the above manner P0: (∀ i: 0≤i<t machine i is passive)

  15. Invariant P1 (cont.) • A machine can be either black or white • P1: (∃ j: t ≤ j ≤ N: machine j is black) • Rule 1: When machine j sends a message to machine i<j, it becomes black

  16. Rule 1- Example 0 3 1 2

  17. Invariant P1 (cont.) • Now P= P0 ∨ P1 is not falsified when a message is sent to i < j. • Machine 0 knows: • (t=0 ∧ machine 0 is white)  ¬P1 • P0: (∀ i: 0≤i<t machine i is passive) • Therefore- machine 0 can still detect termination

  18. But… 0 3 1 2

  19. Invariant P2 • P1 may be falsified when a black machine hands the token over • We want to ensure that every token propagation that falsifies P1 establishes P2 • We define that the token may be either black or white

  20. Invariant P2 (cont) • P2: the token is black • And the accompanying rule: • Rule 2: A black machine transmits a black token. A white machine doesn’t change the colour of the token

  21. Invariant P2 (cont) • Machine 0 knows: • (t=0 ∧ machine 0 is white)  ¬P1 - Token is white  ¬P2 • P0: (∀ i: 0≤i<t machine i is passive) • Therefore- machine 0 can still detect termination

  22. Invariant P2- Example 0 3 1 2

  23. Rule 3 • The algorithm may finish unsuccessfully • Rule 3: after an unsuccessful round, machine 0 initiates another round

  24. But… 0 3 1 2

  25. Rule 4 • Since a round that begun with a black token is doomed, we adopt: • Rule 4: at the beginning of a new round, machine 0 makes itself white and transmits a white token

  26. Still not good enough 0 3 1 2

  27. Rule 5 • Whitening a black machine i may falsify only P1, and only in the case i > t • Rule 5: when transmitting the token to machine i+1, machine i makes itself white P1: (∃ j: t ≤ j ≤ N: machine j is black)

  28. Final example 0 3 1 2

More Related