Download presentation
Presentation is loading. Please wait.
1
Message Passing Systems A Formal Model
2
The System Topology – network (connected undirected graph) Processors (nodes) Communication channels (edges) Algorithm : A local program for each processor
3
Notation n processors: p 0, p 1, …, p n-1. Q i : the state set for p i. Orientation: A numbering of the edges incident to p i, from 1 to r. outbuf i [l], inbuf i [l].
4
Initialization Qi has a subset of initial states. inbuf i [l] is empty. outbuf i [l] not necessarily empty.
5
More Definitions The accessible state of p i : Q i together with inbuf i [l] for all l. Transition function (relation) of p i : From: The accessible states of p i. To : Qi. inbufi[l] empty for all l. At most one message added to each outbuf i [l].
6
Configuration A vector [q 0,q 1,…,q n-1 ] where q i is a state of p i outbuf i [l] inbuf i [l] An initial configuration
7
Events Computation : comp(i) Delivery : del(i,j,m)
8
Execution C 0 1 C 1 2 C 2 3 … C i : A configuration i : An event C 0 : An initial configuration
9
Conditions Safety Conditions (Nothing bad happens) Liveness Conditions (Something good happens) – Termination ?
10
Asynchronous Systems No Upper bound on times Delivery Consecutive steps of processors Why Asynchronous algorithms ? Schedule : = 1 2 3 … Not every sequence is a schedule: del (1,2,m)
11
Asynchronous Systems (Contd.) exec (C 0, ) Admissible executions Infinitely many comp(i) events for each i. Each message sent is eventually delivered.
12
Synchronous Systems Rounds. A round: comp(i) events for each i. del events for each message sent in the round. Admissible execution: infinite.
13
Message Complexity The total number of messages sent during any admissible execution of the algorithm. In other words, the number of delivery events.
14
Time Complexity Synchronous: The number of rounds until termination. Asynchronous : A time t i is associated with every event i : t i+1 >= t i. t i grow w/o bound in any infinite execution. t i = t i+1 only if they occur in the same processor.
15
Time Complexity (Contd.) Delay(m) = t j -t i where i and j are comp events m is sent in i m is processed in j Given any execution, normalize time s.t. the maximum delay is 1 (Execution is infinite, but the number of messages is finite). Time Complexity: The time at termination.
16
Time Complexity We prove by induction on d that: A processor at distance d from r receives the message M by time d. For the synchronous case we prove that it is received exactly at time t.
17
Pseudo Code Conventions We may describe the effect of any subset of messages in inbuf in separate code fragments for clarity, but.. The processor will execute the codes corresponding to all the messages in inbuf. The subscript i is omitted. Terminate brings the processor to a termination state.
18
Pseudo Code for PI (Flooding) Upon receiving no message:
19
Pseudo Code for PI (Flooding) Upon receiving M from neighbor p j :
20
Pseudo Code for PI (Flooding) Upon receiving PARENT from neighbor p j : Upon receiving REJECT from neighbor p j :
21
Correctness By code inspection, at each processor: Once parent is set, it is never changed. If parent set then. If i=r, parent=i. Otherwise, parent != i. The set children never decreases. The set other never decreases.
22
Correctness (cont’d) Eventually: At processor p r,parent=r. (immediate) At other processors, parent != nil Assume a processor with parent=nil, Consider a path from p r to to this processor. Let p the first processor on this path with parent = nil, and q the processor before it. (Both exist). Consider what happened when q set its parent variable…
23
Correctness (cont’d) The graph defined by the parent variables: (without the self loop). Has n-1 edges Has no cycles: Assume a cycle of length l < n. p r is not in the cycle. Consider the computation events in any admissible schedule which caused to parent = ? There are l such events. Consider the first event. Contradiction.
24
Distributed Computing Fundamentals, Simulations and Advanced Topics H. Attiya and J. Welch Section 2.1
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.