Presentation is loading. Please wait.

Presentation is loading. Please wait.

Two-Process Systems TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AA Companion slides for Distributed Computing.

Similar presentations


Presentation on theme: "Two-Process Systems TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AA Companion slides for Distributed Computing."— Presentation transcript:

1 Two-Process Systems TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AA Companion slides for Distributed Computing Through Combinatorial Topology Maurice Herlihy & Dmitry Kozlov & Sergio Rajsbaum Distributed Computing through Combinatorial Topology

2 Two-Process Systems Two-process systems can be captured by elementary graph theory gentle introduction to more general structures needed later for larger systems Distributed Computing through Combinatorial Topology 2

3 Road Map Elementary Graph Theory Tasks Models of Computation Approximate Agreement Task Solvability Distributed Computing through Combinatorial Topology 3

4 Road Map Elementary Graph Theory Tasks Models of Computation Approximate Agreement Task Solvability Distributed Computing through Combinatorial Topology 4

5 A Vertex Distributed Computing through Combinatorial Topology 5

6 A Vertex Combinatorial: an element of a set. Distributed Computing through Combinatorial Topology 6

7 A Vertex Combinatorial: an element of a set. Geometric: a point in Euclidean Space Distributed Computing through Combinatorial Topology 7

8 An Edge 8

9 Combinatorial: a set of two vertexes. 9

10 An Edge Combinatorial: a set of two vertexes. Geometric: line segment joining two points 10

11 A Graph Distributed Computing through Combinatorial Topology 11

12 A Graph Combinatorial: a set of sets of vertices. Distributed Computing through Combinatorial Topology 12

13 A Graph Combinatorial: a set of sets of vertices. Geometric: points joined by line segments Distributed Computing through Combinatorial Topology 13

14 Graphs finite set V with a collection G of subsets of V, Distributed Computing through Combinatorial Topology 14

15 Graphs simplices (singular: simplex) simplices (singular: simplex) finite set V with a collection G of subsets of V, vertices Distributed Computing through Combinatorial Topology 15

16 Graphs Distributed Computing through Combinatorial Topology (1) If X 2 G, then |X| · 2 finite set V with a collection G of subsets of V, 16

17 Graphs Distributed Computing through Combinatorial Topology (1) If X 2 G, then |X| · 2 finite set V with a collection G of subsets of V, vertex: |X| = 1 edge: |X|= 2 17

18 Graphs (1) If X 2 G, then |X| · 2 (2) for all v 2 V, {v} 2 G finite set V with a collection G of subsets of V, 18

19 Graphs (1) If X 2 G, then |X| · 2 (2) for all v 2 V, {v} 2 G (3) for all X 2 G, and Y ½ X, Y 2 G finite set V with a collection G of subsets of V, 19

20 Dimension dim(X) = |X|-1. dimension 0 dimension 1 Distributed Computing through Combinatorial Topology 20

21 Pure Graphs pure of dim 0 pure of dim 1 Distributed Computing through Combinatorial Topology 21

22 Graph Coloring Distributed Computing through Combinatorial Topology 22

23 Graph Coloring Â: G ! C Distributed Computing through Combinatorial Topology 23

24 Graph Coloring Â: G ! C for each edge (s 0, s 1 ) 2 G, Â(s 0 )  Â(s 1 ). Distributed Computing through Combinatorial Topology 24

25 Graph Coloring Â: G ! C for each edge (s 0, s 1 ) 2 G, Â(s 0 )  Â(s 1 ). usually process names chromatic graphs Distributed Computing through Combinatorial Topology 25

26 Graph Labeling 1 0 0 1 Distributed Computing through Combinatorial Topology 26

27 Graph Labeling 1 0 0 1 f: G ! L Distributed Computing through Combinatorial Topology 27

28 Graph Labeling 1 0 0 1 f: G ! L usually values from some domain Distributed Computing through Combinatorial Topology 28

29 Labeled Chromatic Graph 0 1 1 0 name(s) = Â(s) view(s) = f(s) Distributed Computing through Combinatorial Topology 29

30 Simplicial Maps Vertex-to-vertex map … that also sends edges to edges. Distributed Computing through Combinatorial Topology 30

31 Rigid Simplicial Maps A simplicial map can send an edge to a vertex … Distributed Computing through Combinatorial Topology 31

32 Rigid Simplicial Maps A simplicial map can send an edge to a vertex … A simplicial map that sends distinct vertices to distinct vertices is rigid. Distributed Computing through Combinatorial Topology 32

33 A Path Between two Vertices Distributed Computing through Combinatorial Topology 33

34 A Path Between two Vertices A graph is connected if there is a path between every pair of vertices Distributed Computing through Combinatorial Topology 34

35 Not Connected A graph is connected if there is a path between every pair of vertices Distributed Computing through Combinatorial Topology 35

36 Theorem Distributed Computing through Combinatorial Topology Theorem Á The image of a connected graph under a simplicial map is connected. 36

37 Carrier Maps Distributed Computing through Combinatorial Topology ©: G ! 2 H For graphs G, H, a carrier map Carries each simplex of G to a subgraph of H … © 37

38 Carrier Maps Distributed Computing through Combinatorial Topology ©: G ! 2 H For graphs G, H, a carrier map Carries each simplex of G to a subgraph of H … © satisfying monotonicity: for all ¾,¿ 2G, if ¾ µ ¿, then ©(¾) µ ©(¿). satisfying monotonicity: for all ¾,¿ 2G, if ¾ µ ¿, then ©(¾) µ ©(¿). 38

39 Monotonicity Strict Carrier Maps Distributed Computing through Combinatorial Topology For all ¾,¿ 2G, if ¾ µ ¿, then ©(¾) µ ©(¿). 39

40 Monotonicity Strict Carrier Maps Distributed Computing through Combinatorial Topology For all ¾,¿ 2G, if ¾ µ ¿, then ©(¾) µ ©(¿). Equivalent to … ©(¾ Å ¿) µ ©(¾) Å ©(¿) 40

41 Monotonicity Strict Carrier Maps Distributed Computing through Combinatorial Topology For all ¾,¿ 2G, if ¾ µ ¿, then ©(¾) µ ©(¿). Equivalent to … ©(¾ Å ¿) µ ©(¾) Å ©(¿) Definition © is strict if ©(¾ Å ¿) = ©(¾) Å ©(¿) 41

42 Road Map Elementary Graph Theory Tasks Models of Computation Approximate Agreement Task Solvability Distributed Computing through Combinatorial Topology 42

43 Two Processes Distributed Computing through Combinatorial Topology Hello! I’m Alice Hello! I’m Alice Hello! I’m Bob Hello! I’m Bob 43

44 Informal Task Definition Distributed Computing through Combinatorial Topology Processes start with input values … They communicate … They halt with output values … legal for those inputs. 44

45 Formal Task Definition Distributed Computing through Combinatorial Topology Input graph I all possible assignments of input values 45

46 Formal Task Definition Distributed Computing through Combinatorial Topology Input graph I all possible assignments of input values Output graph O all possible assignments of output values 46

47 Formal Task Definition Distributed Computing through Combinatorial Topology Input graph I all possible assignments of input values Output graph O all possible assignments of output values Carrier map ¢: I ! 2 O all possible assignments of output values for each input 47

48 Task Input Graph: Consensus Distributed Computing through Combinatorial Topology 1 10 0 I 48

49 Task Input Graph Distributed Computing through Combinatorial Topology 01 1 0 I 49

50 Task Input Graph Distributed Computing through Combinatorial Topology 11 0 0 Pure Colored by process names Labeled by input values 50

51 Task Output Graph Distributed Computing through Combinatorial Topology 11 0 0 O 51

52 Task Carrier Map Distributed Computing through Combinatorial Topology 11 00 11 00 ¢: I ! 2O¢: I ! 2O IO 52

53 Task Carrier Map Distributed Computing through Combinatorial Topology 11 00 11 00 ¢: I ! 2O¢: I ! 2O IO If Bob runs alone with input 1 … then he decides output 1. 53

54 Task Carrier Map Distributed Computing through Combinatorial Topology 11 00 11 00 ¢: I ! 2O¢: I ! 2O IO If Bob and Alice both have input 1 … then they both decide output 1. 54

55 Task Carrier Map Distributed Computing through Combinatorial Topology 11 00 11 00 ¢: I ! 2O¢: I ! 2O IO If Bob has 1 and Alice 0 … then they must agree, on either one. 55

56 Example: Coordinated Attack 56 Alice and Bob win If they both attack together Alice and Bob win If they both attack together Alice Bob Distributed Computing through Combinatorial Topology Enemy

57 Indifferent Attack at dawn!Attack at noon! Input Graph Distributed Computing through Combinatorial Topology I 57

58 Output Graph Distributed Computing through Combinatorial Topology dawn! noon! failed! O 58

59 Carrier Map Distributed Computing through Combinatorial Topology ¢ I O 59

60 Carrier Map Distributed Computing through Combinatorial Topology ¢ dawn! failed! dawn! I O 60

61 Carrier Map Distributed Computing through Combinatorial Topology ¢ noon! failed! noon! I O 61

62 Carrier Map Distributed Computing through Combinatorial Topology ¢ dawn! I O 62

63 Example: Coordinated Attack 63 Alice Bob Distributed Computing through Combinatorial Topology Enemy

64 Example: Coordinated Attack 64 Alice Bob Distributed Computing through Combinatorial Topology Enemy Alice and Bob realize that they do not need to agree on an exact time …

65 Example: Coordinated Attack 65 Alice Bob Distributed Computing through Combinatorial Topology Enemy Alice and Bob realize that they do not need to agree on an exact time … they will win if attack times are sufficiently close.

66 0101/52/53/54/51 Coordinated Attack Graphs Distributed Computing through Combinatorial Topology ¢ I O 66

67 0101/52/53/54/51 Coordinated Attack Graphs Distributed Computing through Combinatorial Topology ¢ I O 67

68 0101/52/53/54/51 Coordinated Attack Graphs Distributed Computing through Combinatorial Topology ¢ I O 68

69 0101/52/53/54/51 Coordinated Attack Graphs Distributed Computing through Combinatorial Topology ¢ I O 69

70 Road Map Elementary Graph Theory Tasks Models of Computation Approximate Agreement Task Solvability Distributed Computing through Combinatorial Topology 70

71 Protocols Distributed Computing through Combinatorial Topology Models of Computation 71

72 Alice’s Protocol 72 shared mem array 0..1 of Value view: Value := my input value; for i: int := 0 to L do mem[A] := view; view := view + mem[A] + mem[B]; return δ (view) Finite program Bob’s protocol is symmetric Distributed Computing through Combinatorial Topology

73 shared mem array 0..1 of Value view: Value := my input value; for i: int := 0 to L do mem[A] := view; view := view + mem[B]; return δ (view) Alice’s Protocol 73 Distributed Computing through Combinatorial Topology shared two-element memory

74 shared mem array 0..1 of Value view: Value := my input value; for i: int := 0 to L do mem[A] := view; view := view + mem[B]; return δ (view) Alice’s Protocol 74 Distributed Computing through Combinatorial Topology Start with input value

75 shared mem array 0..1 of Value view: Value := my input value; for i: int := 0 to L do mem[A] := view; view := view + mem[B]; return δ (view) Alice’s Protocol 75 Distributed Computing through Combinatorial Topology Run for L layers

76 shared mem array 0..1 of Value view: Value := my input value; for i: int := 0 to L do mem[A] := view; view := view + mem[B]; return δ (view) Alice’s Protocol 76 Distributed Computing through Combinatorial Topology Alice writes her value, read Bob’s value, and concatenate it to my view

77 shared mem array 0..1 of Value view: Value := my input value; for i: int := 0 to L do mem[A] := view; view := view + mem[B]; return δ (view) Alice’s Protocol 77 Distributed Computing through Combinatorial Topology Alice writes her value, read Bob’s value, and concatenate it to my view (full-information protocol)

78 shared mem array 0..1 of Value view: Value := my input value; for i: int := 0 to L do mem[A] := view; view := view + mem[B]; return δ (view) Alice’s Protocol 78 Distributed Computing through Combinatorial Topology finally, apply task-specific decision map to view

79 Formal Protocol Definition Distributed Computing through Combinatorial Topology Input graph I all possible assignments of input values 79

80 Formal Protocol Definition Distributed Computing through Combinatorial Topology Input graph I all possible assignments of input values Protocol graph P all possible process views after execution 80

81 Formal Protocol Definition Distributed Computing through Combinatorial Topology Input graph I all possible assignments of input values Protocol graph P all possible process views after execution Carrier map ¥: I ! 2 P all possible assignments of views 81

82 One-Round Protocol Graph Distributed Computing through Combinatorial Topology 100?0? 01 ?1?1 ¥ I P 82

83 One-Round Protocol Graph Distributed Computing through Combinatorial Topology 0?0? 01 ?1?1 Colored by process names Labeled with final views P 83

84 One-Round Protocol Graph Distributed Computing through Combinatorial Topology 0?0? 01 ?1?1 Alice finishes before Bob starts, doesn’t see his value P 84

85 One-Round Protocol Graph Distributed Computing through Combinatorial Topology 0?0? 01 ?1?1 Alice and Bob run together, she sees his value. Alice and Bob run together, she sees his value. P 85

86 One-Round Protocol Graph Distributed Computing through Combinatorial Topology 0?0? 01 ?1?1 Alice finishes, then Bob starts P 86

87 One-Round Protocol Graph Distributed Computing through Combinatorial Topology 0?0? 01 ?1?1 Alice and Bob run together P 87

88 One-Round Protocol Graph Distributed Computing through Combinatorial Topology 0?0? 01 ?1?1 Bob can’t tell whether Alice saw him P 88

89 Execution Carrier Map Distributed Computing through Combinatorial Topology 100?0? 01 ?1?1 ¥ I P 89

90 Execution Carrier Map Distributed Computing through Combinatorial Topology 100?0? 01 ?1?1 ¥ I P ¥: I ! 2 P strict carrier map ¥(¾) Å ¥(¿) = ¥(¾ Å ¿) strict carrier map ¥(¾) Å ¥(¿) = ¥(¾ Å ¿) 90

91 Output graph 02/31/31 0?0? 01 ?1?1 Protocol graph δ The Decision Map Distributed Computing through Combinatorial Topology δ 91

92 All Together Distributed Computing through Combinatorial Topology 01 02/31/31 0?0? 01 ?1?1 ¢ δ I P O ¥ 92

93 Definition Distributed Computing through Combinatorial Topology Decision map δ is carried by carrier map ¢ if for each input vertex s, for each input edge ¾, δ(¥(s)) µ ¢(s) δ(¥(¾)) µ ¢(¾). 93

94 Meaning 94 δ(¥(s)) µ ¢(s) process strarts in state s

95 Meaning 95 δ(¥(s)) µ ¢(s) runs the protocol to completion

96 Meaning 96 δ(¥(s)) µ ¢(s) makes a decision …

97 Meaning 97 δ(¥(s)) µ ¢(s) decision is permitted by task carrier map

98 Definition Solving a Task Distributed Computing through Combinatorial Topology The protocol ( I, P,¥) solves the task ( I, O, ¢) 98

99 Definition Solving a Task Distributed Computing through Combinatorial Topology The protocol ( I, P,¥) solves the task ( I, O, ¢) if there is … 99

100 Definition Solving a Task Distributed Computing through Combinatorial Topology The protocol ( I, P,¥) solves the task ( I, O, ¢) if there is … a simplicial decision map δ:P ! Oδ:P ! O δ:P ! Oδ:P ! O 100

101 Definition Solving a Task Distributed Computing through Combinatorial Topology The protocol ( I, P,¥) solves the task ( I, O, ¢) if there is … a simplicial decision map δ:P ! Oδ:P ! O δ:P ! Oδ:P ! O 101 such that δ is carried by ¢. (δ agrees with ¢)

102 Layered Read-Write Model 102

103 Layered Read-Write Protocol Distributed Computing through Combinatorial Topology 103 shared mem array 0..1,0..L of Value view: Value := my input value; for i: int := 0 to L do mem[i][A] := view; view := view + mem[A] + mem[B]; return δ (view)

104 shared mem array 0..1,0..L of Value view: Value := my input value; for i: int := 0 to L do mem[i][A] := view; view := view + mem[A] + mem[B]; return δ (view) As before, run for L layers Layered Read-Write Protocol Distributed Computing through Combinatorial Topology 104

105 shared mem array 0..1,0..L of Value view: Value := my input value; for i: int := 0 to L do mem[i][A] := view; view := view + mem[A] + mem[B]; return δ (view) Layered Read-Write Protocol Distributed Computing through Combinatorial Topology Each layer uses a distinct, “clean” memory 105

106 Layered R-W Protocol Graph Distributed Computing through Combinatorial Topology 100?0? 01 ?1?1 ¥ I P 106

107 Layered R-W Protocol Graph Distributed Computing through Combinatorial Topology ¥ P is always a subdivision of I IP 107

108 Road Map Elementary Graph Theory Tasks Models of Computation Approximate Agreement Task Solvability Distributed Computing through Combinatorial Topology 108

109 Alice’s 1/3-Agreement Protocol Distributed Computing through Combinatorial Topology mem[A] := 0 other := mem[B] if other == ? then decide 0 else decide 1/3 109

110 Alice’s 1/3-Agreement Protocol Distributed Computing through Combinatorial Topology mem[A] := 0 if mem[B] == ? then decide 0 else decide 1/3 Alice writes her value to memory 110

111 Alice’s 1/3-Agreement Protocol Distributed Computing through Combinatorial Topology mem[A] := 0 if mem[B] == ? then decide 0 else decide 1/3 If she doesn’t see Bob’s value, decide her own. 111

112 Alice’s 1/3-Agreement Protocol Distributed Computing through Combinatorial Topology mem[A] := 0 if mem[B] == ? then decide 0 else decide 1/3 If she see’s Bob’s value, jump to the middle 112

113 02/31/31 02/31/31 02/31/31 Distributed Computing through Combinatorial Topology 113

114 One-Layer 1/3-Agreement Protocol Distributed Computing through Combinatorial Topology 01 02/31/31 0?0? 01 ?1?1 δ I P O ¥ 114

115 No 1-Layer 1/5-Agreement Protocol Distributed Computing through Combinatorial Topology 01 1/53/52/54/5 0?0? 01 ?1?1 δ P O ¥ 1 0 (no map possible) I 115

116 10 01/52/53/54/51 ¥ 0?0? 01 ?1?1 2-Layer 1/5-Agreement Distributed Computing through Combinatorial Topology ¥ I O layer 1 layer 2 δ 116

117 Fact Distributed Computing through Combinatorial Topology In the layered read-write model, The 1/K-Agreement Task Has a d log 3 K e –layer protocol 117

118 Road Map Elementary Graph Theory Tasks Models of Computation Approximate Agreement Task Solvability Distributed Computing through Combinatorial Topology 118

119 Fact Distributed Computing through Combinatorial Topology The protocol graph for any L-layer protocol with input graph I is a subdivision of I, where each edge is subdivided 3 L times. 119

120 Main Theorem Distributed Computing through Combinatorial Topology The two-process task ( I, O, ¢) is solvable in the layered read-write model if and only if there exists a connected carrier map ©: I ! 2 O carried by ¢. 120

121 Corollary Distributed Computing through Combinatorial Topology The consensus task has no layered read-write protocol 121

122 Corollary Distributed Computing through Combinatorial Topology Any ²–agreement task has a layered read-write protocol 122

123 123 This work is licensed under a Creative Commons Attribution- ShareAlike 2.5 License.Creative Commons Attribution- ShareAlike 2.5 License You are free: –to Share — to copy, distribute and transmit the work –to Remix — to adapt the work Under the following conditions: –Attribution. You must attribute the work to “Distributed Computing through Combinatorial Topology” (but not in any way that suggests that the authors endorse you or your use of the work). –Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to –http://creativecommons.org/licenses/by-sa/3.0/. Any of the above conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the author's moral rights. Distributed Computing through Combinatorial Topology


Download ppt "Two-Process Systems TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AA Companion slides for Distributed Computing."

Similar presentations


Ads by Google