concurrent counting is harder than queuing

81
1 Concurrent Counting is harder than Queuing Costas Busch Rensselaer Polytechnic Intitute Srikanta Tirthapura Iowa State University

Upload: sonya-james

Post on 31-Dec-2015

26 views

Category:

Documents


2 download

DESCRIPTION

Concurrent Counting is harder than Queuing. Costas Busch Rensselaer Polytechnic Intitute Srikanta Tirthapura Iowa State University. Arbitrary graph. Distributed Counting. count. count. count. count. Some processors request a counter value. Distributed Counting. Final state. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Concurrent Counting  is harder than Queuing

1

Concurrent Counting is harder than Queuing

Costas BuschRensselaer Polytechnic Intitute

Srikanta TirthapuraIowa State University

Page 2: Concurrent Counting  is harder than Queuing

2

Arbitrary graph

Page 3: Concurrent Counting  is harder than Queuing

3

Distributed Counting

Some processors request a counter value

count

count

count

count

Page 4: Concurrent Counting  is harder than Queuing

4

Distributed Counting

Final state

2

1

34

Page 5: Concurrent Counting  is harder than Queuing

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

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

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

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

9

Queuing vs Counting?

Total ordersQueuing = finding predecessorNeeds local knowledge

Counting = finding rankNeeds global knowledge

Page 10: Concurrent Counting  is harder than Queuing

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

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

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

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

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

15

Theorem:

Proof:

Consider some arbitrary algorithmfor counting

For graphs with diameter :D

)( 2DCounting Cost =

Page 16: Concurrent Counting  is harder than Queuing

16

Take shortest path of length

Graph

D

Page 17: Concurrent Counting  is harder than Queuing

17

Graph

make these nodes to count

12 3 4567 8

Page 18: Concurrent Counting  is harder than Queuing

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

19

Counting Cost: )(2

1 2

1

DkD

k

End of Proof

Page 20: Concurrent Counting  is harder than Queuing

20

Theorem:

Counting Cost = )log( * nnFor arbitrary graphs:

Proof:

Consider some arbitrary algorithmfor counting

Page 21: Concurrent Counting  is harder than Queuing

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

22

The initial state affects the outcome

Red: countBlue: don’t count

v

Initial State

Page 23: Concurrent Counting  is harder than Queuing

23

Final state

Red: count

v

1

23

4

5

Blue: don’t count

Page 24: Concurrent Counting  is harder than Queuing

24

Initial state

Red: count

v

Blue: don’t count

Page 25: Concurrent Counting  is harder than Queuing

25

Final state

Red: count

v

1

2

3

45

6 78

Blue: don’t count

Page 26: Concurrent Counting  is harder than Queuing

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

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

28

v

)(vA

k

v

)(vA

k

These two initial states give same result forv

Page 29: Concurrent Counting  is harder than Queuing

29

v

)(vA

k

If , then would decide less than

kvA |)(|

k

Thus, kvA |)(|

v

Page 30: Concurrent Counting  is harder than Queuing

30

Suppose that decides at timetv

We show:

22|)(| vA

2

2t times

Page 31: Concurrent Counting  is harder than Queuing

31

Suppose that decides at timetv

kvA |)(|

22|)(| vA

2

2t

times

kt *log

Page 32: Concurrent Counting  is harder than Queuing

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

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

34

v

)1,( tvA

v

)1,( tvB

After , the sets grow1t

1)( ta 1)( tb

Page 35: Concurrent Counting  is harder than Queuing

35

),( tvA

v

)1,( tvA

Page 36: Concurrent Counting  is harder than Queuing

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

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

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

39

),( tvA

v

),( tzA

z

)1,( tvA

),( tsA

s

Eligible to send messageat time 1t

),(),( tzAtsATherefore:

Page 40: Concurrent Counting  is harder than Queuing

40

),( tzA

z

),( tsA

s

Number of nodes like : s )()( tbta

|),(|max txAx |),(|max txBx

Page 41: Concurrent Counting  is harder than Queuing

41

),( tvA

v

),( tzA

z

)1,( tvA

),( tsA

s

Therefore: )()()(),()1,( tbtatatvAtvA

Page 42: Concurrent Counting  is harder than Queuing

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

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

44

An arbitrary graph

Page 45: Concurrent Counting  is harder than Queuing

45

Spanning tree

Page 46: Concurrent Counting  is harder than Queuing

46

Spanning tree

Page 47: Concurrent Counting  is harder than Queuing

47

A

A

Distributed Queue

HeadTail

Tail

Previous = Nil

Page 48: Concurrent Counting  is harder than Queuing

48

A

B enq(B)

Tail A

HeadTail

Previous = ?

Previous = Nil

Page 49: Concurrent Counting  is harder than Queuing

49

A

B

enq(B)

Tail A

HeadTail

Previous = ?

Previous = Nil

Page 50: Concurrent Counting  is harder than Queuing

50

A

B

enq(B)

Tail A

HeadTail

Previous = ?

Previous = Nil

Page 51: Concurrent Counting  is harder than Queuing

51

A

B

enq(B)

Tail A

HeadTail

Previous = ?

Previous = Nil

Page 52: Concurrent Counting  is harder than Queuing

52

A

B

enq(B)

Tail A

HeadTail

Previous = ?

Previous = Nil

Page 53: Concurrent Counting  is harder than Queuing

53

A

A

B

Tail

Previous = A

BA informs B

HeadTail

Previous = Nil

Page 54: Concurrent Counting  is harder than Queuing

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

55

A

Tail

BC

A

HeadTail

enq(B)enq(C)Previous = ? Previous = ?

Previous = Nil

Page 56: Concurrent Counting  is harder than Queuing

56

A

Tail

BC

A

HeadTail

enq(B)

enq(C)

Previous = ? Previous = ?

Previous = Nil

Page 57: Concurrent Counting  is harder than Queuing

57

A

Tail

BC

enq(B)

AC

HeadTail

Previous = A Previous = ?

Previous = Nil

Page 58: Concurrent Counting  is harder than Queuing

58

A

Tail

BCenq(B)

AC

HeadTail

Previous = A Previous = ?

Previous = Nil

Page 59: Concurrent Counting  is harder than Queuing

59

A

Tail

BC

AC

HeadTail

C informs B

Previous = CPrevious = A

B

Previous = Nil

Page 60: Concurrent Counting  is harder than Queuing

60

A

Tail

BC

AC

HeadTail

Previous = CPrevious = A

B

Previous = Nil

Page 61: Concurrent Counting  is harder than Queuing

61

A

Tail

BC

AC

HeadTail

Previous = CPrevious = A

B

Previous = Nil

Paths of enqueue requests

Page 62: Concurrent Counting  is harder than Queuing

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

63

A

C B

Visit closest unused node in Tree

ED F

Page 64: Concurrent Counting  is harder than Queuing

64

A

C B

Visit closest unused node in Tree

ED F

Page 65: Concurrent Counting  is harder than Queuing

65

A

C B

ED F

Nearest-Neighbor TSP tour

Page 66: Concurrent Counting  is harder than Queuing

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

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

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

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

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

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

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

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

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

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

76

If the spanning tree is a list, then

Theorem:

Queuing Cost = )(nO

Page 77: Concurrent Counting  is harder than Queuing

77

Nearest Neighbor TSP

Queuing Cost = O(Nearest-Neighbor TSP)

Proof:

Page 78: Concurrent Counting  is harder than Queuing

78

x y

yx

ab

ab 2

Page 79: Concurrent Counting  is harder than Queuing

79

Length doubles

Total length n2

n nodes

Even sides

Page 80: Concurrent Counting  is harder than Queuing

80

Length doubles

n nodes

Total length n2

Odd sides

Page 81: Concurrent Counting  is harder than Queuing

81

n nodes

Total length nnn 422

Even+Odd sides

End of proof