Termination Detection n n definition motivation for termination

  • Slides: 9
Download presentation
Termination Detection n n definition motivation for termination detection main concepts in termination announcement

Termination Detection n n definition motivation for termination detection main concepts in termination announcement termination detection u Dijkstra-Scholten termination detection for diffusing comptuations u Shavit-Francez generalization u wave-based u snapshot and weight-throwing-based

Definitions n n n terminal state (fixpoint) – no actions enabled terminal state of

Definitions n n n terminal state (fixpoint) – no actions enabled terminal state of process – a special local state of a process where no event of the process is applicable deadlock is an example of terminal state termination u implicit (message termination) - state that allows the receipt of messages but there are no messages in the channels - no action can be executed but the processes are not aware of termination u explicit (process termination) - a terminal state with every process in terminal state and no messages in channels implicit termination is easier to design since the processes do not need to know the algorithm terminated

Why Termination Detection n objective - convert message terminating algorithms into process terminating. achieved

Why Termination Detection n objective - convert message terminating algorithms into process terminating. achieved by adding two additional algorithms. The original algorithm is called basic algorithm. The added algorithms perform two tasks: u termination detection – recognize that the basic algorithm is in message terminating state u termination announcement – makes all processes go into designated terminating state the added algorithms may exchange messages. They are called control messages

More Definitions n n n event can be internal or external (receipt of message)

More Definitions n n n event can be internal or external (receipt of message) each basic process is assumed to be in one of two states: u active - an action of the process is enabled (able to execute) u passive - no process actions are enabled variable statep represents whether process is active or passive the following assumptions about basic algorithms: u active process becomes passive only on internal event u process always becomes active when a message is received u internal events where process becomes passive are the only internal events (we ignore active events) diffusing computation (centralized algorithm)- algorithm where only one process is active in every initial state u this process is called initiator

Termination Announcement n n n n To announce termination stop control message is flooded

Termination Announcement n n n n To announce termination stop control message is flooded to all processes each process sends stop message to every neighbor messages are sent at most once: u on local call to Announce u on receiving the first stop the algorithm terminates when it receives stop from every neighbor the algorithm works on directed and undirected networks, requires no identities, leader or topological knowledge what does this algorithm resemble? what happens when multiple nodes call announce simultaneously?

Dijkstra-Scholten Termination Detection n n n The algorithm works on diffusing computations only, p

Dijkstra-Scholten Termination Detection n n n The algorithm works on diffusing computations only, p 0 is initiator the algorithm dynamically maintains a computation tree T=(VT, ET) u Either T is empty, or T is a directed tree with root p 0 u VT includes all active processes and all basic messages in transit initiator calls Announce when p 0 VT (which implies that T is empty) when process p sends basic message mes it becomes the father of this message when mes is received by q u if q is involved in computation (does not have a father) it set p to be its father u q has a father it sends message sig back to p each process p maintains variable scp that counts the number of sons u every time p sends mes , scp is incremented u every time p receives sig it is decremented u when scp is 0 and p is passive, it sends sig to its parent

Termination detection Sp - basic send Rp - basic receive Ip - change from

Termination detection Sp - basic send Rp - basic receive Ip - change from active to passive Ap - arrival of signal

Shavit-Francez Generalization to the Decentralized Algorithm n n n n Dijkstra-Scholten algorithm works only

Shavit-Francez Generalization to the Decentralized Algorithm n n n n Dijkstra-Scholten algorithm works only on diffusing computations (one initiator) Shavit-Francez suggested generalization to decentralized algorithms (multiple initiators) in their algorithm each initiator maintains a computation tree similar to Dijkstra. Scholten problem - when the tree on one initiator collapsed the initiator does not know if the computation terminated - there still may be other trees solution - all processes participate in a wave u non-initiator process continues the wave u initiator process continues the wave only if its tree has collapsed by definition of wave a process decides only when all system processes made at least one move. Thus when one process decides the basic computation terminates. when process decides - it calls Announce

Termination Detection Using Snapshots and Weight Throwing n n snapshots u when process becomes

Termination Detection Using Snapshots and Weight Throwing n n snapshots u when process becomes passive it initiates a snapshot u if an active process receives a snapshot message, it ignores it u eventually, a snapshot succeeds, if this snapshot does not have messages in transition detect termination F if a snapshot succeeds, does it mean that the basic alg. terminated? weight throwing u each active process starts with a certain quantity (weight). The sum of all weights is 1. u when a process sends a message it sends part of its weight with it, when message arrives, the process adds the message’s weight to its own u when a process becomes passive, it sends its weight to initiator u when initiator’s weight is equal to 1, detect termination