1 / 9

Distributed Algorithms (22903)

Distributed Algorithms (22903). Approximate agreement. Lecturer: Danny Hendler. This presentation is based on the book “Distributed Computing” by Hagit attiya & Jennifer Welch. Approximate Agreement. Wait-freedom : Eventually, each nonfaulty process decides.

nieve
Download Presentation

Distributed Algorithms (22903)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DistributedAlgorithms (22903) Approximate agreement Lecturer: Danny Hendler This presentation is based on the book “Distributed Computing” by Hagit attiya & Jennifer Welch.

  2. Approximate Agreement • Wait-freedom: Eventually, each nonfaulty process decides. • -Agreement: All decisions are within  of each other. • Validity: All decisions are within the range of the input values.

  3. Approximate Agreement Algorithm:assuming input range is known • Assume processes know the range from which input values are drawn: • let D be the length of this range • algorithm is structured as a series of "asynchronous rounds": • exchange values via a snapshot object, one per round • compute midpoint for next round • continue until spread of values is within , which requires about log2D/rounds

  4. Program for process i • For r = 1 to to M • updatei(ASO[r], v) ;update v’s entry in the r’th snapshot object • values[r] := scan(ASO[r]) ;take the r’th snapshot • v := midpoint(values[r]) ;adjust estimate • return v Approximate Agreement Algorithm (cont’d) Constant: M= max( log2 (D/) ,1) Shared:Snapshot ASO[M] initialized to emptyLocal:int v;this is pi's estimate, initialized with pi’s input int r ;this is the asynchronous round number values[M];array to store snapshots taken in M rounds

  5. Correctness proof Lemma 1: Consider any round r < M. There exists a value, u, such that the values written to ASO[r+1] are in this range: u min(Ur) (min(Ur)+u)/2 (max(Ur)+u)/2 max(Ur) elements of Ur+1 are in this range

  6. Handling Unknown Input Range • Range might not be known. • Actual range in an execution might be much smaller than maximum possible range, so number of rounds may be reduced.

  7. Handling Unknown Input Range • Use just one atomic snapshot object • Dynamically recalculate how many rounds are needed as more inputs are revealed • Skip over rounds to try to catch up to maximum observed round • Only consider values associated with maximum observed round • Still use midpoint

  8. Approximate Agreement Algorithm (unknown inputs range) Shared:Snapshot S, each entry is of the form <x,r,v>, initially emptyLocal:int v ;this is pi’s estimate, initialized with pi’s input int rmax;this is maximal round number I saw values ;a set of numbers • Program for process i • S.updatei(<x,1,x>) ;estimate in round 1 is my value • repeat • <x0,r0,v0>,…,<xn-1,rn-1,vn-1> := S.scan() ;take a snapshot • maxRound := max(log2(spread(x0,…xn-1)/ε), 1) • rmax:= max{r0,…,rn-1} ;maximal round number I saw so far • values := {vj | rj = rmax, 0 ≤j ≤n-1} ;only consider maximal round • S.updatei(<x, rmax+1, midpoint(<values>)) ;skip to rmax+1 round • until rmax ≥ maxRound ;until ε -agreement is guaranteed • return midpoint(values)

  9. The algorithm is a correct wait-free implementation of approximate-agreement

More Related