Download - Concurrent Counting is harder than Queuing
![Page 1: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/1.jpg)
1
Concurrent Counting is harder than Queuing
Costas BuschRensselaer Polytechnic Intitute
Srikanta TirthapuraIowa State University
![Page 2: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/2.jpg)
2
Arbitrary graph
![Page 3: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/3.jpg)
3
Distributed Counting
Some processors request a counter value
count
count
count
count
![Page 4: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/4.jpg)
4
Distributed Counting
Final state
2
1
34
![Page 5: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/5.jpg)
5
Distributed Queuing
Some processors perform enqueue operations
Enq(A) Enq(B)
Enq(D)
Enq(C)
A B
C
D
![Page 6: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/6.jpg)
6
Distributed Queuing
A B
C
D
headTail
A BC D
Previous=nil
Previous=B
Previous=D
Previous=A
![Page 7: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/7.jpg)
7
Counting: - parallel scientific applications - load balancing (counting networks)
Queuing:- distributed directories for mobile
objects- distributed mutual exclusion
Applications
![Page 8: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/8.jpg)
8
Multicast with the condition:all messages received at all nodes in the same order
Either Queuing or Counting will do
Which is more efficient?
Ordered Multicast
![Page 9: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/9.jpg)
9
Queuing vs Counting?
Total ordersQueuing = finding predecessorNeeds local knowledge
Counting = finding rankNeeds global knowledge
![Page 10: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/10.jpg)
10
ProblemIs there a formal sense in which Counting
is harder problem than Queuing?
Reductions don’t seem to help
![Page 11: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/11.jpg)
11
Our Result Concurrent Counting is harder than
Concurrent Queuing
on a variety of graphs including: many common interconnection
topologies complete graph, mesh hypercube perfect binary trees
![Page 12: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/12.jpg)
12
Model
Synchronous system G=(V,E) - edges of unit delay
Congestion: Each node can process only one message in a single time step
Concurrent one-shot scenario:a set R subset V of nodes issue queuing (or
counting) operations at time zeroNo more operations added later
![Page 13: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/13.jpg)
13
Cost Model : delay till v gets back queuing result
Cost of algorithm A on request set R is
Queuing Complexity =
Define Counting Complexity Similarly
)(vCQ
Rv
QQ vCRAC )(),(
)},({maxmin RACQVRA
![Page 14: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/14.jpg)
14
Lower Bounds on Counting
Counting Cost = )log( * nn
For arbitrary graphs:
For graphs with diameter :D
)( 2DCounting Cost =
![Page 15: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/15.jpg)
15
Theorem:
Proof:
Consider some arbitrary algorithmfor counting
For graphs with diameter :D
)( 2DCounting Cost =
![Page 16: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/16.jpg)
16
Take shortest path of length
Graph
D
![Page 17: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/17.jpg)
17
Graph
make these nodes to count
12 3 4567 8
![Page 18: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/18.jpg)
18
k
Node of count decides after at least time steps
k
21k
Needs to be aware of other processors k-1
21k
21k
![Page 19: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/19.jpg)
19
Counting Cost: )(2
1 2
1
DkD
k
End of Proof
![Page 20: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/20.jpg)
20
Theorem:
Counting Cost = )log( * nnFor arbitrary graphs:
Proof:
Consider some arbitrary algorithmfor counting
![Page 21: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/21.jpg)
21
Prove it for a complete graph with nodes:
any algorithm on any graph with nodes can be simulated on the complete graph
n
n
![Page 22: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/22.jpg)
22
The initial state affects the outcome
Red: countBlue: don’t count
v
Initial State
![Page 23: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/23.jpg)
23
Final state
Red: count
v
1
23
4
5
Blue: don’t count
![Page 24: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/24.jpg)
24
Initial state
Red: count
v
Blue: don’t count
![Page 25: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/25.jpg)
25
Final state
Red: count
v
1
2
3
45
6 78
Blue: don’t count
![Page 26: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/26.jpg)
26
v
Let be the set of nodes whose input may affect the decision of
)(vAv
)(vA
![Page 27: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/27.jpg)
27
Suppose that there is an initial statefor which decides v k
kvA |)(|Then:
v
)(vA
k
![Page 28: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/28.jpg)
28
v
)(vA
k
v
)(vA
k
These two initial states give same result forv
![Page 29: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/29.jpg)
29
v
)(vA
k
If , then would decide less than
kvA |)(|
k
Thus, kvA |)(|
v
![Page 30: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/30.jpg)
30
Suppose that decides at timetv
We show:
22|)(| vA
2
2t times
![Page 31: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/31.jpg)
31
Suppose that decides at timetv
kvA |)(|
22|)(| vA
2
2t
times
kt *log
![Page 32: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/32.jpg)
32
kt *log
)log(log *
1
* nnkn
k
Cost of node : v
If nodes wish to count:n
Counting Cost =
![Page 33: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/33.jpg)
33
v
),( tvA
Nodes that affectup to time
vt
v
),( tvB
Nodes that affectsup to timev
t
|),(|max)( txAta x |),(|max)( txBtb x
![Page 34: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/34.jpg)
34
v
)1,( tvA
v
)1,( tvB
After , the sets grow1t
1)( ta 1)( tb
![Page 35: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/35.jpg)
35
),( tvA
v
)1,( tvA
![Page 36: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/36.jpg)
36
),( tvA
v
)1,( tvA
),( tzA
Eligible to send messageat time
z
1t
There is an initial state such thatthat sends a message to z v
![Page 37: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/37.jpg)
37
),( tvA
v
),( tzA
z
)1,( tvA
),( tsA
s
),(),( tzAtsA
Eligible to send messageat time 1t
Suppose that
Then, there is an initial state such that both send message tov
![Page 38: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/38.jpg)
38
),( tvA
v
),( tzA
z
)1,( tvA
),( tsA
s
Eligible to send messageat time 1t
However, can receive one message at a time v
![Page 39: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/39.jpg)
39
),( tvA
v
),( tzA
z
)1,( tvA
),( tsA
s
Eligible to send messageat time 1t
),(),( tzAtsATherefore:
![Page 40: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/40.jpg)
40
),( tzA
z
),( tsA
s
Number of nodes like : s )()( tbta
|),(|max txAx |),(|max txBx
![Page 41: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/41.jpg)
41
),( tvA
v
),( tzA
z
)1,( tvA
),( tsA
s
Therefore: )()()(),()1,( tbtatatvAtvA
![Page 42: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/42.jpg)
42
)()(1)()1( tbtatata
We can also show: )(21)()1( tatbtb
Thus:
Which give:
22)( a
2
2
times
End of Proof
![Page 43: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/43.jpg)
43
Upper Bound on Queuing
)log( nnOQueuing Cost =
For graphs with spanning trees of constant degree:
)(nOQueuing Cost =
For graphs whose spanning trees are lists or perfect binary trees:
![Page 44: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/44.jpg)
44
An arbitrary graph
![Page 45: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/45.jpg)
45
Spanning tree
![Page 46: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/46.jpg)
46
Spanning tree
![Page 47: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/47.jpg)
47
A
A
Distributed Queue
HeadTail
Tail
Previous = Nil
![Page 48: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/48.jpg)
48
A
B enq(B)
Tail A
HeadTail
Previous = ?
Previous = Nil
![Page 49: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/49.jpg)
49
A
B
enq(B)
Tail A
HeadTail
Previous = ?
Previous = Nil
![Page 50: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/50.jpg)
50
A
B
enq(B)
Tail A
HeadTail
Previous = ?
Previous = Nil
![Page 51: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/51.jpg)
51
A
B
enq(B)
Tail A
HeadTail
Previous = ?
Previous = Nil
![Page 52: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/52.jpg)
52
A
B
enq(B)
Tail A
HeadTail
Previous = ?
Previous = Nil
![Page 53: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/53.jpg)
53
A
A
B
Tail
Previous = A
BA informs B
HeadTail
Previous = Nil
![Page 54: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/54.jpg)
54
A
Concurrent Enqueue Requests
Tail
BC
A
HeadTail
enq(B)enq(C)Previous = ? Previous = ?
Previous = Nil
![Page 55: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/55.jpg)
55
A
Tail
BC
A
HeadTail
enq(B)enq(C)Previous = ? Previous = ?
Previous = Nil
![Page 56: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/56.jpg)
56
A
Tail
BC
A
HeadTail
enq(B)
enq(C)
Previous = ? Previous = ?
Previous = Nil
![Page 57: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/57.jpg)
57
A
Tail
BC
enq(B)
AC
HeadTail
Previous = A Previous = ?
Previous = Nil
![Page 58: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/58.jpg)
58
A
Tail
BCenq(B)
AC
HeadTail
Previous = A Previous = ?
Previous = Nil
![Page 59: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/59.jpg)
59
A
Tail
BC
AC
HeadTail
C informs B
Previous = CPrevious = A
B
Previous = Nil
![Page 60: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/60.jpg)
60
A
Tail
BC
AC
HeadTail
Previous = CPrevious = A
B
Previous = Nil
![Page 61: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/61.jpg)
61
A
Tail
BC
AC
HeadTail
Previous = CPrevious = A
B
Previous = Nil
Paths of enqueue requests
![Page 62: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/62.jpg)
62
Nearest-Neighbor TSP tour
on Spanning tree
A
C B
D
Origin(first element in queue)
E F
![Page 63: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/63.jpg)
63
A
C B
Visit closest unused node in Tree
ED F
![Page 64: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/64.jpg)
64
A
C B
Visit closest unused node in Tree
ED F
![Page 65: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/65.jpg)
65
A
C B
ED F
Nearest-Neighbor TSP tour
![Page 66: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/66.jpg)
66
Queuing Cost 2 x Nearest-Neighbor TSP length
[Herlihy, Tirthapura, Wattenhofer PODC’01]
For spanning tree of constant degree:
![Page 67: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/67.jpg)
67
Nearest-NeighborTSP length
OptimalTSP length
[Rosenkratz, Stearns, Lewis SICOMP1977]
If a weighted graph satisfies triangular inequality:
nlogx
![Page 68: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/68.jpg)
68
A
C
D
B
E F
A
C
D
B
F2
4
4
13
12
3
1
weighted graph of distances
E1
23 4
2
1
![Page 69: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/69.jpg)
69
Satisfies triangular inequality
A
C
D2
1
11e
2e3e
)()()( 321 ewewew
A
C
D
B
F2
4
4
13
12
3
1
E1
23 4
2
1
![Page 70: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/70.jpg)
70
A
C
E
B
FD
Nearest Neighbor TSP tour
A
C
D
B
F2
4
4
13
12
3
1
E1
23 4
2
1
Length=8
![Page 71: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/71.jpg)
71
A
C
E
B
FD
A
C
D
B
F2
4
4
13
12
3
1
E1
23 4
2
1
Optimal TSP tour
Length=6
![Page 72: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/72.jpg)
72
It can be shown that:
Optimal TSP length n2
A
C
E
B
FD
(Nodes in graph)
Since every edge is visited twice
![Page 73: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/73.jpg)
73
Therefore, for constant degree spanning tree:
Queuing Cost = O(Nearest-Neighbor TSP)
)log( nnO
= O(Optimal TSP x )nlog
=
![Page 74: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/74.jpg)
74
For special cases we can do better:
Spanning Tree is
Queuing Cost = )(nO
List balanced binary tree
![Page 75: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/75.jpg)
75
Graphs with Hamiltonian path,have spanning trees which are lists
Complete graph
Queuing Cost = )(nO
Mesh Hypercube
Counting Cost = )log( * nn
![Page 76: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/76.jpg)
76
If the spanning tree is a list, then
Theorem:
Queuing Cost = )(nO
![Page 77: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/77.jpg)
77
Nearest Neighbor TSP
Queuing Cost = O(Nearest-Neighbor TSP)
Proof:
![Page 78: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/78.jpg)
78
x y
yx
ab
ab 2
![Page 79: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/79.jpg)
79
Length doubles
Total length n2
n nodes
Even sides
![Page 80: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/80.jpg)
80
Length doubles
n nodes
Total length n2
Odd sides
![Page 81: Concurrent Counting is harder than Queuing](https://reader030.vdocuments.us/reader030/viewer/2022032708/56812ebc550346895d945e47/html5/thumbnails/81.jpg)
81
n nodes
Total length nnn 422
Even+Odd sides
End of proof