Message Complexity Analysis of Shavit

Message Complexity Analysis of ShavitFrancez Termination Detection Algorithm
By:- Rizwan Malik
For Advanced OS Course 2007
Instructor: Dr. Mikhail Nesterenko
Overview








Introduction.
Objective.
Enviornment.
Observations.
Results.
Coding Logic.
Conclusion & Future Work.
References.
Introduction



Shavit-Francez Algorithm is used for Explicit Termination
of De-centralized Distributed Systems(Systems with
Multiple Initiators).
Every initiator maintains its own computation tree and
when its own computation tree collapses it may
participate in the computation tree of other initiators.
All processes participate in a Wave to detect the the
termination of the Computation.
Objective


To analyze the message complexity of Shavit-Francez
Algorithm.
To determine how to reduce the message complexity by
analyzing different Waves.
Enviornment

Randomly Generated Trees were used for this project.

The Basic Computation was generated randomly.

Message Queue delays were introduced.

For the Wave, Echo and Tree algorithm were used.

Each data point value for the graph is based on an
average of 10 values.
Observations



For a Basic computation with a Message complexity of M, the
algorithm further introduces an increase of M(signals
introduced by S-F Algo) + W(tokens generated by the
Wave)+A(Stop messages sent by the Announce routine)
messages.
The Shavit-Francez Algorithm always runs with
complexity.
worst case
Selection of the Wave Algorithm impacts the overall message
complexity.
Results


The SF Algorithm with tree based
wave has better message
complexity than Echo based Wave.
Message Complexity –
Echo=2E,Tree=N,Announce=2E.
10
20
30
40
50
60
70
80
90
100
200
300
Term with Echo Term with Tree
70.2
62.2
144.2
126.2
207.6
179.6
271.2
233.2
334.6
286.6
404
346
468.2
400.2
525
447
595
507
655.2
557.2
1261.4
1063.4
1871.6
1573.6
Results(Continued)
Since decide event takes place
at all processes in a Tree based
wave, if we halt every process
after it decides, we can achieve
a better message complexity
for the algorithm.However, this
observation is limited to tree
graphs.
M(BC+Signals+Echo+Ann W(BC+Signals+
ounce)
Tree)
10
74.4
56.4
20
137.6
99.6
30
210.8
152.8
40
278.8
200.8
50
342
244
60
401.2
283.2
70
464
326
80
530.4
372.4
90
589.6
411.6
100
650.4
452.4
200
1272.8
874.8
300
1872
1274
Result(Continued..)
No. Of Nodes
Edge Count
Basic Messages
10
20
30
40
50
60
70
80
90
100
200
300
9
19
29
39
49
59
69
79
89
99
199
299
Echo Tokens
17.1
34.1
45.8
57.6
69.3
84
96.1
104.5
119.5
129.6
232.7
337.8
Tree Tokens
18
38
58
78
98
118
138
158
178
198
398
598
Signals
10
20
30
40
50
60
70
80
90
100
200
300
Announce Stop Messages
17.1
34.1
45.8
57.6
69.3
84
96.1
104.5
119.5
129.6
232.7
337.8
18
38
58
78
98
118
138
158
178
198
398
598
Fig1
Fig1– Data for Graph 1 Mcomplexity for Tree=N.Fig2- Mcomplexity = 2N-2=2E(for trees).
No. Of Nodes
10
20
30
40
50
60
70
80
90
100
200
300
Edge Count
9
19
29
39
49
59
69
79
89
99
199
299
Basic Messages Echo Tokens
Tree Tokens
Signals
19.2
18
18
30.8
38
38
47.4
58
58
61.4
78
78
73
98
98
82.6
118
118
94
138
138
107.2
158
158
116.8
178
178
127.2
198
198
238.4
398
398
338
598
598
Announce Stop Messages
19.2
30.8
47.4
61.4
73
82.6
94
107.2
116.8
127.2
238.4
338
18
38
58
78
98
118
138
158
178
198
398
598
Fig2
Coding Logic

Randomly Generated Computation:



Queue Delay:

One message sent/received at a time.
Leaves are initiators.
A process can, at the maximum, send 5 messages.
Delay simulated by Placing the message at index generated randomly
between values 0 and Queue length.
Random Trees:



Matrix(Double indexed array) of size NxN --- N is a user input value.
Value of pair(I,J)=1 denotes the presence of an Edge between I & J.
Recursively checks for cycles before adding an Edge to the tree.
Probability of an Node joining the tree is 50%.
Conclusion & Future Work

Conclusion:



The Shavit-Francez component of the Algorithm always runs with
worst-case message complexity i.e. it always generates number of
messages equal to number of messages generated by the Basic
algorithm.
The choice of wave algorithm to be run can effectively reduce the
message complexity of the Algorithm as a whole.
For Tree networks the wave with best message complexity is Tree
Algorithm based wave.
Future Work:


Perform the same analysis on Arbitrary Graphs.
Find the optimal wave for different graph types.
To work towards genralize the technique of converting algorithm that
work on diffusing Algorithms to those that work on non-diffusing
Algorithms as suggested by N. Shavit, N. Francez in their paper titled
“A New Approach to Detection of Locally Indicative Stability“.
References



Class notes for Advances Operating Systems 2007 by Dr.
Mikhail Nesterenko.
Introduction to Distributed Algorithms By Gerard Tel.
Nir Shavit, Nissim Francez: A New Approach to
Detection of Locally Indicative Stability.