1 concurrent counting is harder than queuing costas busch rensselaer polytechnic intitute srikanta...
Post on 19-Jan-2018
212 views
Embed Size (px)
DESCRIPTION
3 Distributed Counting Some processors request a counter value countTRANSCRIPT
Concurrent Counting is harder than Queuing
Costas Busch
Rensselaer Polytechnic Intitute
Srikanta Tirthapura
Iowa State University
Arbitrary graph
Distributed Counting
Some processors request a counter value
count
count
count
count
Distributed Counting
Final state
Distributed Queuing
Some processors perform enqueue operations
Enq(A)
Enq(B)
Enq(D)
Enq(C)
A
B
C
D
Distributed Queuing
A
B
C
D
head
Tail
A
B
C
D
Previous=nil
Previous=B
Previous=D
Previous=A
Counting: - parallel scientific applications - load balancing (counting networks)
Queuing:- distributed directories for mobile objects- distributed mutual exclusion
Applications
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
Queuing vs Counting?
Total orders
Queuing = finding predecessor
Needs local knowledge
Counting = finding rank
Needs global knowledge
Problem
Is there a formal sense in which Counting is harder problem than Queuing?
Reductions dont seem to help
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
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 zero
No more operations added later
Cost Model
: delay till v gets back queuing result
Cost of algorithm A on request set R is
Queuing Complexity =
Define Counting Complexity Similarly
Lower Bounds on Counting
Counting Cost =
For arbitrary graphs:
For graphs with diameter :
Counting Cost =
Theorem:
Proof:
Consider some arbitrary algorithm
for counting
For graphs with diameter :
Counting Cost =
Take shortest path of length
Graph
Graph
make these nodes to count
1
2
3
4
5
6
7
8
k
Node of count decides after
at least time steps
Needs to be aware of other processors
k-1
Counting Cost:
End of Proof
Theorem:
Counting Cost =
For arbitrary graphs:
Proof:
Consider some arbitrary algorithm
for counting
Prove it for a complete graph with nodes:
any algorithm on any graph with nodes
can be simulated on the complete graph
The initial state affects the outcome
Red: count
Blue: dont count
Initial State
Final state
Red: count
1
2
3
4
5
Blue: dont count
Initial state
Red: count
Blue: dont count
Final state
Red: count
1
2
3
4
5
6
7
8
Blue: dont count
Let be the set of nodes whose
input may affect the decision of
Suppose that there is an initial state
for which decides
Then:
These two initial states give same result for
If , then would decide
less than
Thus,
Suppose that decides at time
We show:
times
Suppose that decides at time
times
Cost of node :
If nodes wish to count:
Counting Cost =
Nodes that
affect
up to time
Nodes that
affects
up to time
After , the sets grow
Eligible to
send message
at time
There is an initial state such that
that sends a message to
Eligible to
send message
at time
Suppose that
Then, there is an initial state such that
both send message to
Eligible to
send message
at time
However, can receive one message at a time
Eligible to
send message
at time
Therefore:
Number of nodes like :
Therefore:
We can also show:
Thus:
Which give:
times
End of Proof
Upper Bound on Queuing
Queuing Cost =
For graphs with spanning trees
of constant degree:
Queuing Cost =
For graphs whose spanning trees
are lists or perfect binary trees:
An arbitrary graph
Spanning tree
Spanning tree
A
A
Distributed Queue
Head
Tail
Tail
Previous = Nil
A
B
enq(B)
Tail
A
Head
Tail
Previous = ?
Previous = Nil
A
B
enq(B)
Tail
A
Head
Tail
Previous = ?
Previous = Nil
A
B
enq(B)
Tail
A
Head
Tail
Previous = ?
Previous = Nil
A
B
enq(B)
Tail
A
Head
Tail
Previous = ?
Previous = Nil
A
B
enq(B)
Tail
A
Head
Tail
Previous = ?
Previous = Nil
A
A
B
Tail
Previous = A
B
A informs B
Head
Tail
Previous = Nil
A
Concurrent Enqueue Requests
Tail
B
C
A
Head
Tail
enq(B)
enq(C)
Previous = ?
Previous = ?
Previous = Nil
A
Tail
B
C
A
Head
Tail
enq(B)
enq(C)
Previous = ?
Previous = ?
Previous = Nil
A
Tail
B
C
A
Head
Tail
enq(B)
enq(C)
Previous = ?
Previous = ?
Previous = Nil
A
Tail
B
C
enq(B)
A
C
Head
Tail
Previous = A
Previous = ?
Previous = Nil
A
Tail
B
C
enq(B)
A
C
Head
Tail
Previous = A
Previous = ?
Previous = Nil
A
Tail
B
C
A
C
Head
Tail
C informs B
Previous = C
Previous = A
B
Previous = Nil
A
Tail
B
C
A
C
Head
Tail
Previous = C
Previous = A
B
Previous = Nil
A
Tail
B
C
A
C
Head
Tail
Previous = C
Previous = A
B
Previous = Nil
Paths of enqueue requests
Nearest-Neighbor TSP tour
on Spanning tree
A
C
B
D
Origin
(first element in queue)
E
F
A
C
B
Visit closest unused node in Tree
E
D
F
A
C
B
Visit closest unused node in Tree
E
D
F
A
C
B
E
D
F
Nearest-Neighbor TSP tour
Queuing Cost
x Nearest-Neighbor
TSP length
[Herlihy, Tirthapura, Wattenhofer PODC01]
For spanning tree of constant degree:
Nearest-Neighbor
TSP length
Optimal
TSP length
[Rosenkratz, Stearns, Lewis SICOMP1977]
If a weighted graph satisfies
triangular inequality:
x
A
C
D
B
E
F
A
C
D
B
F
2
4
4
1
3
1
2
3
1
weighted graph of distances
E
1
2
3
4
2
1
Satisfies triangular inequality
A
C
D
2
1
1
A
C
D
B
F
2
4
4
1
3
1
2
3
1
E
1
2
3
4
2
1
A
C
E
B
F
D
Nearest Neighbor TSP tour
A
C
D
B
F
2
4
4
1
3
1
2
3
1
E
1
2
3
4
2
1
Length=8
A
C
E
B
F
D
A
C
D
B
F
2
4
4
1
3
1
2
3
1
E
1
2
3
4
2
1
Optimal TSP tour
Length=6
It can be shown that:
Optimal TSP length
A
C
E
B
F
D