Presentation is loading. Please wait.

Presentation is loading. Please wait.

How Shall I Name Thee? Let me count the ways...

Similar presentations


Presentation on theme: "How Shall I Name Thee? Let me count the ways..."— Presentation transcript:

1 How Shall I Name Thee? Let me count the ways...
Hagit Attiya, Technion Armando Castañeda, Technion Maurice Herlihy, Brown Ami Paz, Technion

2 Renaming M-Renaming Unbounded identifiers Unique names in 1,…,M p1 p1
5 Renaming p2 p2 8 p3 p3 2 Processes are only compare their identifiers Unbounded identifiers Unique names in 1,…,M

3 ? M-Renaming Bounds M 1,...,n 1,...,n n+1,... 2n-2 2n-1,... 2n-1,...
n is a prime power ? n is not a prime power

4 Weak Symmetry Breaking (WSB)
p1 p1 WSB p2 p2 p3 p3 0 / 1 outputs not all 0’s or all 1’s Processes only compare their identifiers If newname < n output 1, otherwise, output 0 WSB  (2n-2)-renaming WSB solvable  n is a prime power

5 Model ... p1 p2 p3 pn read write n asynchronous processes, communicating by atomic read / write operations Wait-free algorithms: a process outputs after a finite number of steps, regardless of the others n, not n+1

6 Today Impossibility of WSB when n is a prime power
n-process algorithm for WSB when n is not a prime power, with 𝑂 𝑛 𝑞+5 step complexity (𝑞 is the largest prime factor of 𝑛)  Same results for (2𝑛−2)-renaming

7 Immediate Snapshots (IS)
An execution is a sequence of blocks: sets of processes that Write together and then Scan (read everything) together We are not going to look at all the executions. Clearly, this is enough for a lower bound, but as we’ll see it’s also enough for the upper bound. The execution it totally captured by the sequence of blocks

8 IS Executions Indistinguishable executions: α ~ 𝑝 𝛼′, if the process p has the same view in α and in 𝛼′

9 IS Executions Indistinguishable executions: α ~ 𝑝 𝛼′, if the process p has the same view in α and in 𝛼′ A process is seen in 𝛼 if it appears in some other process' view; otherwise, it is unseen

10 AR Lemma Indistinguishable executions: α ~ 𝑝 𝛼′, if the process p has the same view in α and in 𝛼′ A process is seen in 𝛼 if it appears in some other process' view; otherwise, it is unseen If 𝑝 𝑖 is seen in an IS execution 𝛼 by P, then there is a unique IS execution 𝛼 ′ ≠ 𝛼 by P s.t. α ~ 𝑃− 𝑝 𝑖 𝛼′ Also, 𝑝 𝑖 is seen in 𝛼′ The lemma is used both in the lower bound and the upper bound

11 AR Lemma: Proof (Case 1) ~ Consider the last seen round of 𝑝 𝑖
If 𝑝 𝑖 is seen in an IS execution 𝛼 by P, then there is a unique IS execution 𝛼 ′ ≠ 𝛼 by P s.t. α ~ 𝑃− 𝑝 𝑖 𝛼′ Also, 𝑝 𝑖 is seen in 𝛼′

12 AR Lemma: Proof (Case 2) ~ Consider the last seen round of 𝑝 𝑖
If 𝑝 𝑖 is seen in an IS execution 𝛼 by P, then there is a unique IS execution 𝛼 ′ ≠ 𝛼 by P s.t. α ~ 𝑃− 𝑝 𝑖 𝛼′ Also, 𝑝 𝑖 is seen in 𝛼′

13 Pairing AR Lemma means that the IS executions by P in which 𝑝 𝑖 is seen can be divided into pairs If 𝑝 𝑖 is seen in an IS execution 𝛼 by P, then there is a unique IS execution 𝛼 ′ ≠ 𝛼 by P s.t. α ~ 𝑃− 𝑝 𝑖 𝛼′ Also, 𝑝 𝑖 is seen in 𝛼′

14 The Lower Bound

15 Univalued Signed Count (USC)
For an IS execution 𝛼 𝑠𝑖𝑔𝑛 𝛼 = α has an even # of even−sized blocks −1 α has an odd # of even−sized blocks Odd-sized blocks do not affect the sign AR Lemma gives executions with opposite signs only 0 is output in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 is output in α 𝒔𝒊𝒈𝒏 𝜶 Blocks === sets???

16 Proof Strategy Prove that the USC of a WSB algorithm is ≠𝟎
Trim the algorithm, preserving the USC Prove the trimmed algorithm has USC ≠𝟎 The algorithm has a univalued IS execution! only 0 is output in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 is output in α 𝒔𝒊𝒈𝒏 𝜶

17 A : Trimming an Algorithm A
When all processes show up, there is little uncertainty  Outcome is determined by the partial execution before all processes show up Write your input and scan If all processes have arrived, output 0 Repeat: Simulate a step of A, write and scan If all processes arrive, output 1 If A outputs, output the same

18 A : Trimming an Algorithm A
A and A have the same univalued signed count Write your input and scan If all processes have arrived, output 0 Repeat: Simulate a step of A, write and scan If all processes arrive, output 1 If A outputs, output the same

19 Proof of Trimming A and A have the same univalued signed count
(0, … ,0,…,0) (1, … ,1,0,0,…,0) (1, … ,1,1,0,…,0) (1, … ,1,…,1) Cancel similar pairs using opposite signs

20 Proof of Trimming 𝑋 𝐴 are all tuples (𝛼, 𝑝 𝑖 ) s.t.
A and A have the same univalued signed count 𝑋 𝐴 are all tuples (𝛼, 𝑝 𝑖 ) s.t. 𝑝 0 , …, 𝑝 𝑖−1 output 1 in 𝛼 𝑝 𝑖+1 , …, 𝑝 𝑛−1 output 0 in 𝛼 signed count of 𝐴 = 𝛼, 𝑝 𝑖 ∈ 𝑋 𝐴 (−1) 𝑖 ∙𝑠𝑖𝑔𝑛(𝛼) (0, … ,0,…,0) (1, … ,1,?,0,…,0) (1, … ,1,…,1) Cancel similar pairs using opposite signs

21 Signed Count = USC (part 1)
{0,1} is output in 𝛼 Output vector = (1,…,1,0,..,0) ∃ 𝑝 𝑖 , 𝑝 𝑖+1 s.t. 𝛼, 𝑝 𝑖 , 𝛼, 𝑝 𝑖+1 ∈ 𝑋 𝐴 Cancel out in the signed count USC = only 0 is output in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 is output in α 𝒔𝒊𝒈𝒏 𝜶

22 Signed Count = USC (part 2)
{0} or {1} is output in 𝛼 𝛼 appears in the USC, and with the same sign Same holds for 𝑋 𝐴 USC = only 0 is output in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 is output in α 𝒔𝒊𝒈𝒏 𝜶

23 Signed Count of 𝐴 and 𝐴 ( 𝑝 𝑖 seen)
𝑝 𝑖 is seen in 𝛼: Cancel out by AR Lemma. Same holds for 𝐴

24 Signed Count of 𝐴 and 𝐴 ( 𝑝 𝑖 unseen)
𝑝 𝑖 is unseen in 𝛼: Let 𝛼 be an execution of 𝐴 induced by the same blocks (until 𝑝 𝑖 runs alone) 𝑠𝑖𝑔𝑛(𝛼) = 𝑠𝑖𝑔𝑛 𝛼 , all but 𝑝 𝑖 decide the same  𝛼, 𝑝 𝑖 𝜖 𝑋 𝐴 𝐴 and 𝐴 have the same signed count 𝐴 and 𝐴 have the same USC

25 What is the USC of A ? only 0 in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 in α 𝒔𝒊𝒈𝒏 𝜶 No execution in which only 1 is output (last process to start always outputs 0) Write your input and scan If all processes have arrived, output 0 Repeat: Simulate a step of A, write and scan If all processes arrive, output 1 If A outputs, output the same

26 What is the USC of A ? only 0 in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 in α 𝒔𝒊𝒈𝒏 𝜶 No execution in which only 1 is output (last process to start always outputs 0) Write your input and scan If all processes have arrived, output 0 Repeat: Simulate a step of A, write and scan If all processes arrive, output 1 If A outputs, output the same

27 What is the USC of A ? All processes output 0 if they arrive together
only 0 in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 in α 𝒔𝒊𝒈𝒏 𝜶 All processes output 0 if they arrive together Write your input and scan If all processes have arrived, output 0 Repeat: Simulate a step of A, write and scan If all processes arrive, output 1 If A outputs, output the same

28 What is the USC of A ? All processes output 0 if they arrive together
only 0 in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 in α 𝒔𝒊𝒈𝒏 𝜶 All processes output 0 if they arrive together But there could be other executions in which all processes output 0 Need to assume the algorithm is symmetric

29 Symmetric Algorithms E.g., the same outputs in an execution by p1, p2, p3 and the equivalent execution with p1, p2, p4 Equivalent executions have the same sign p3 p1 p2 p1 p2 p4 There are several definitions of this notion, and they are morally equivalent. It’s a rather sticky point, and we’ll work with this definition Same execution means they have the same structure and processes are replaced with the same rank.

30 What is the USC of A ? One execution contributes 1
only 0 in α 𝒔𝒊𝒈𝒏 𝜶 −𝟏 𝒏 ∗ only 1 in α 𝒔𝒊𝒈𝒏 𝜶 One execution contributes 1 Take a univalued execution in which 0< 𝒎<𝑛 processes output 0 in A 𝑛 𝑚 equivalent executions (with same sign) in which all processes output 0 When 𝑛= 𝑞 𝑒 , they contribute 0 mod 𝑞 to the USC  USC =1 mod 𝒒  USC ≠𝟎

31 The Upper Bound

32 Topology 101: Simplex Set of vertexes Dimension: Number of vertexes -1
A face is a sub-simplex Chromatic: vertexes have different colors 𝑥 𝑥,𝑦 𝑥,𝑦,𝑧 𝑥,𝑦,𝑧,𝑤

33 Topology 101: Simplicial Complexes
Gluing simplexes together Some complexes are subdivisions of others

34 Distributed Computing  Topology
A vertex represents a local state of a process A simplex represents a global system state y x z x z The state could be the input state (essentially, just the input) or the view after performing an algorithm [Borowsky and Gafni 93]; [Herlihy and Shavit 93,99]; [Saks and Zaharoglou 93,00]; [Herlihy and Rajsbaum 94,00]. a

35 Distributed Computing  Topology
Glue together indistinguishabile executions y x z x z Here, just one process (green) distinguishes between the two executions a a

36 Distributed Computing  Topology
Glue together indistinguishabile executions If 𝑝 𝑖 is seen in an IS execution 𝛼 by P, then there is a unique IS execution 𝛼 ′ ≠ 𝛼 by P s.t. α ~ 𝑃− 𝑝 𝑖 𝛼′ Also, 𝑝 𝑖 is seen in 𝛼′ Note that now the number of processes will be n+1, so the dimension is n… In the complex of IS executions, a simplex shares each face (of dimension n) with one simplex

37 Distributed Computing  Topology
Glue together indistinguishabile executions Initial configurations, glued together, make the input complex The IIS executions correspond to the standard (chromatic) subdivision of the input complex Colors represent different processes In the complex of IS executions, a simplex shares each face (of dimension n) with one simplex

38 IS Executions as the Standard Subdivision: 2 Processes
The rest really uses Iterated Immediate Snapshots, to be precise. But due to timing constraints, I did not elaborate on that.

39 IIS Executions as the Standard Subdivision: 2 Processes

40 IIS Executions as the Standard Subdivision: 3 Processes

41 IIS Executions as the Standard Subdivision: 3 Processes

42 IIS Executions as the Standard Subdivision: 3 Processes

43 Standard Subdivision (Std S)
StdK S = apply the standard subdivision K times

44 Iterated Immediate Snapshot
Each process starts on a corner of Stdk S After 𝑘 iterations of immediate snapshot end on a simplex, spanned by the participating processes 𝑂( 𝑛 2 ) steps per iteration [Borowsky Gafni] 𝑂( 𝑛 2 ∙𝑘) step complexity Each iteration is performed on a fresh copy of the memory

45 Solving WSB Do 𝑘 iterated immediate snapshots & output the value associated with the vertex (its output function) WSB is solved by finding 𝑘 and an output function from Stdk S

46 Output Function for WSB
Binary values No univalued n-simplexes Symmetric on the boundaries

47 Output Function for WSB
Binary values No univalued n-simplexes Symmetric on the boundaries An output function from StdK S gives a WSB algorithm with O(Kn2) step complexity

48 Two-Step Plan (and a Detour)
Step 1: find k and a (boundary symmetric) output function from StdK S whose univalued signed count is 0 (only 0-univalued n-simplexes) Step 2: remove the univalued n-simplexes in StdK S, while preserving symmetry n simplex means simplex of dimension n, i.e., with n+1 vertexes

49 Step One: Zero USC Number of subsets with 𝑚 processes: 𝑛 𝑚
If n is not a prime power, these quantities are relatively prime  there are small 𝑘 1 , …, 𝑘 𝑛−1 such that 𝟏+ 𝒎=𝟏 𝒏−𝟏 𝒏 𝒎 𝒌 𝒎 =𝟎 There is a solution with small values: | 𝑘 𝑖 |< 𝑛 2

50 Step One: Univalued Signed Count
USC = 1+ 𝑖=1 𝑛−1 𝑛 𝑖 𝑘 𝑖 =0 Std S

51 Step One: Univalued Signed Count
USC = 1+ 𝑖=1 𝑛−1 𝑛 𝑖 𝑘 𝑖 =0 Std S Symmetrically pick simplexes in every subdivision of a face of dimension i

52 Step One: Univalued Signed Count
USC = 1+ 𝑖=1 𝑛−1 𝑛 𝑖 𝑘 𝑖 =0 Std S Divide and then extend

53 Step One: Univalued Signed Count
USC = 1+ 𝑖=1 𝑛−1 𝑛 𝑖 𝑘 𝑖 =0 Divide and then extend

54 Step One: Univalued Signed Count
USC = 1+ 𝑖=1 𝑛−1 𝑛 𝑖 𝑘 𝑖 =0 Divide and then extend Not standard subdivision In the background, do a standard subdivision and lift the coloring to it. The problem happens at another part of the proof; we may return to this towards the end of the construction.

55 Step One: Univalued Signed Count
USC = 1+ 𝑖=1 𝑛−1 𝑛 𝑖 𝑘 𝑖 =0 ki univalued simplexes from each face of dimension i

56 Step One: Univalued Signed Count
USC = 1+ 𝑖=1 𝑛−1 𝑛 𝑖 𝑘 𝑖 =0 Using small (k1, ... ,kn-1)  Step one requires O(1) subdivisions ki univalued simplexes from each face of dimension i Color the rest blue Some ki are negative  some simplexes are counted as -1

57 Step Two: Remove Univalued
Subdivide Std S further to eliminate all univalued n-simplexes Recursive algorithm that cancels a simplex counted +1 with a simplex counted -1 While preserving symmetry on the boundary

58 Step Two: Adjacent Simplexes
Eliminate univalued simplexes by subdivision, while preserving the boundary

59 Step Two: Non-Adjacent Simplexes
Eliminate univalued simplexes by subdivision, while preserving the boundary

60 Step Two: Longer Paths Eliminate univalued simplexes by subdivision, while preserving the boundary Similar construction 𝑂(ℓ) subdivisions for ℓ-length path.

61 Step Two: Path Length Cannot eliminate simplexes with odd distance
Take univalued simplexes with opposite signs AR Lemma  a path between them has even length

62 Step Two: Connect Find a path between univalued simplexes with opposite signs The path is even-length. Why do we have a path?

63 Step Two: Rinse Subdivide until the path has no univalued simplexes
The path is even-length. Why do we have a path?

64 Step Two: Rinse & Repeat
Subdivide until the path has no univalued simplexes

65 Step Two: Rinse & Repeat
Until there are no univalued simplexes

66 Step Two: Number of Subdivisions
Chop into paths with O(n) length, using a constant number of subdivisions

67 Step Two: Number of Subdivisions
Chop into paths with O(n) length, using a constant number of subdivisions O(n) O(n) O(n)

68 Step Two: Number of Subdivisions
Path of O(n) length is treated with O(n) iterations Each iteration partitions a path P into paths of length |P| - 2, using O(1) subdivisions

69 Step Two: Number of Subdivisions
Path of O(n) length is treated with O(n) iterations Each iteration partitions a path P into paths of length |P| - 2, using O(1) subdivisions  Two univalued simplexes are eliminated within O(n) subdivisions

70 Step Two: Number of Subdivisions
Path of O(n) length is treated with O(n) iterations Each iteration partitions a path P into paths of length |P| - 2, using O(1) subdivisions  Two univalued simplexes are eliminated within O(n) subdivisions In O(n) subdivisions, two univalued simplexes are eliminated, regardless of the path’s length From (k1, ... ,kn-1) in step one: O(nq+2) paths in Std S Total number of subdivisions: O(nq+3)

71 We Used Cone Subdivisions
How to get an algorithm? One option is to find an algorithmic meaning of the cone subdivision: it is very related to trimming we have seen in the lower bound proof.

72 Getting an Algorithm Map standard subdivision to cone subdivision Lift the output function

73 Getting an Algorithm Map simplexes to simplexes, preserving
process identifiers structure of the subdivision

74 Getting an Algorithm Iterated immediate snapshots, for an appropriate number of times, then output the associated value

75 Wrap Up Step 1: symmetric subdivision, zero univalued signed count
𝑂(1) subdivisions Step 2: eliminate pairs of univalued simplexes, while preserving symmetry 𝑂( 𝑛 𝑞+3 ) subdivisions Step 3: map from standard subdivision No subdivision

76 My course next semester: 236755 Thesis topics
To be Continued… My course next semester: Thesis topics


Download ppt "How Shall I Name Thee? Let me count the ways..."

Similar presentations


Ads by Google