rep eated computation of a global f unction 1 goals of
play

Rep eated Computation of a Global F unction 1 Goals of the - PowerPoint PPT Presentation

Rep eated Computation of a Global F unction 1 Goals of the lecture Rep eated Computation of a Global F unction Deadlo ck Detection Clo ck Synchronization Distributed Branch and Bound Sea rch


  1. Rep eated Computation of a Global F unction 1 Goals of the lecture Rep eated Computation of a Global F unction � Deadlo ck Detection � Clo ck Synchronization � Distributed Branch and Bound Sea rch � Distributed Debugging c � Vija y K. Ga rg Distributed Systems F all 94

  2. Rep eated Computation of a Global F unction 2 Desirable Cha racteristics � Light Load - not mo re than k messages/time step � High Concurrency - log N time steps k � Symmetry (Equitable W o rkload) - load balancin g - fairness c � Vija y K. Ga rg Distributed Systems F all 94

  3. Rep eated Computation of a Global F unction 3 Some P ossible App roaches � Centralized f f f @ � @ � @ R ? � f - f � f � 6 @ I � @ � @ f f f � Ring-based f : � X � X � X z f f � C � C � C W f f C O � C � C � f f � X y X � X f 9 � � Hiera rchical h � @ � I @ � @ � @ � @ h h � A � A � A � A K A A � � � K A � A � A � A h h h h All links a re logical connections � Vija c y K. Ga rg Distributed Systems F all 94

  4. Rep eated Computation of a Global F unction 4 Message Flo w T able Static Hiera rchy - Numb er of no des (p ro cesse) = 7 time step Messages 1 1 ; 3 ! 2 5 ; 7 ! 6 2 1 ; 3 ! 2 5 ; 7 ! 6 2 ; 6 ! 4 3 1 ; 3 ! 2 5 ; 7 ! 6 2 ; 6 ! 4 �� 4 �� � @ � @ � @ I � @ � @ � @ �� � @ �� � @ 2 6 �� �� � A � A � A � A A K � A � A A � � � K A � A � A � A A � � A � A � A �� �� �� �� � A � A 1 3 5 7 �� �� �� �� c � Vija y K. Ga rg Distributed Systems F all 94

  5. Rep eated Computation of a Global F unction 5 Overlapping T ress 6 � @ � @ � @ � @ � @ � @ 3 2 � @ � @ � @ � @ � @ � @ � @ � @ � @ 4 5 � @ 7 1 � @ � @ � @ � @ � @ � @ � @ � @ � @ 2 6 � @ 4 5 � @ � @ � @ � @ � @ � @ � @ � @ � @ 1 3 � @ 2 6 � @ � @ � @ � @ � @ � @ � @ � @ � @ � @ � @ � @ 1 3 5 7 � Vija c y K. Ga rg Distributed Systems F all 94

  6. Rep eated Computation of a Global F unction 6 Message Flo w T able � Revolving Hiera rchy - numb er of no des = 7 time step Messages idle 1 2 1 ; 3 6 5 ; 7 4 2 4 2 ; 6 5 1 ; 3 7 3 7 4 ; 5 1 2 ; 6 3 4 3 7 ; 1 2 4 ; 5 6 � Reo rganization of Hiera rchy � Reuse of messages 0 1 1 2 3 4 5 6 7 B C B C @ A 5 1 7 2 6 3 4 � Vija c y K. Ga rg Distributed Systems F all 94

  7. Rep eated Computation of a Global F unction 7 Requirements fo r Desired P ermutation � Gather tree constraints - interio r no des of T = subtree of T i i +1 � F airness constraints - No cycle of size less than N . �� 4 �� �� �� 2 6 �� �� �� � � �� �� 3 1 7 5 �� �� �� �� c � Vija y K. Ga rg Distributed Systems F all 94

  8. Rep eated Computation of a Global F unction 8 Interesting but .. � Do es there alw a ys exist such a p ermutation ? � Is there a systematic metho d to �nd it ? � Is there an e�cient implementation fo r it ? � Vija c y K. Ga rg Distributed Systems F all 94

  9. Rep eated Computation of a Global F unction 9 Metho d to Generate the P ermutation 8 � H � H � H � H � H � H � H � H 4 12 � @ � @ � @ � @ � @ � @ 2 6 10 14 � @ � @ � @ � @ � @ � @ � @ � @ 1 3 5 7 9 11 13 15 next ( x ) : [ 0 ev en ( x ) ! x := x= 2; (* gather tree constraint *) 2 n � 1 0 n � 1 odd ( x ) ^ ( x < 2 ) ! x := x + 2 ; (*fairness constraint *) 2 n � 1 odd ( x ) ^ ( x > 2 ) ! 0 [ x = N ! x := ( N � 1) = 2; 2 n � 1 x 6 = N ! y := x � 2 + 2 n 2 d log � 1 e 0 y x := y � 2 ] ] � Vija c y K. Ga rg Distributed Systems F all 94

  10. Rep eated Computation of a Global F unction 10 Implem entati on 1 Q: Who should I send message to at time t ? � t t t msg ( x; t ) = next ( par ent ( next ( x ))) ; if next ( x ) is o dd = nil ; otherwise x is in-o rder lab el next is the new p osition function par ent is the pa rent function fo r in-o rder lab elin g pa rent of x = x with last t w o bits changed to 10 c � Vija y K. Ga rg Distributed Systems F all 94

  11. Rep eated Computation of a Global F unction 11 Implem etati on 2 12 8 � H � H � H � H � H � H � H � H 13 2 4 12 � @ � @ � @ � @ � @ � @ 14 3 6 9 2 6 10 14 � @ � @ � @ � @ � @ � @ � @ � @ 1 3 5 7 9 11 13 15 0 4 7 10 1 5 8 11 msg ( x; t ) = new par ent ( x + t ) � t; if ( x + t ) is a leaf-no de = nil ; otherwise - Just need to sto re new par ent a rra y � Vija c y K. Ga rg Distributed Systems F all 94

  12. Rep eated Computation of a Global F unction 12 Comm unicatio n Required � Communication distance set (CDS) = f new par ent ( j ) � j j j a leaf no de g � p ro cess x will send a message to p ro cess y i� y � x 2 C D S . - fo r N = 15 C D S = f 1 ; 5 ; 8 ; 10 ; 13 ; 14 g : � CDS dep ends on the next function. � Vija c y K. Ga rg Distributed Systems F all 94

  13. Rep eated Computation of a Global F unction 13 Data Gathering and Broadcasting � a p ro cess can send/receive only one message p er time step � require that the same set of messages is used fo r data gath- ering and b roadcasting. � Constraints : 1. fairness contraints - equal load 2. gather tree constraints. - G ( t ) available at t + log N time step at one no de. 3. b roadcast constraints. - G ( t ) available at t + 2 log N time step at all no des. � Vija c y K. Ga rg Distributed Systems F all 94

  14. Rep eated Computation of a Global F unction 14 Message Flo w T able time step Messages 0 0 ! 7 4 ! 6 1 ! 3 2 ! 5 1 7 ! 6 3 ! 5 0 ! 2 1 ! 4 2 6 ! 5 2 ! 4 7 ! 1 0 ! 3 3 5 ! 4 1 ! 3 6 ! 0 7 ! 2 4 4 ! 3 0 ! 2 5 ! 7 6 ! 1 � fairness in w o rkload � four times less messages than static hiera rchy � Vija c y K. Ga rg Distributed Systems F all 94

  15. Rep eated Computation of a Global F unction 15 Metho d to Generate the P ermutation bcnext ( x ) :: 0 [ b = 1 ! x := R S ( x ) 0 0 (* gather tree *) 2 0 ( b = 0) ^ ( b = 0) ! x := R S ( x ) 0 1 1 (* b roadcast *) 2 �� � � 0 a b n � 1 ( b = 0) ^ ( b = 1) ! x := LS LS ( x ) + 2 mo d 2 ; 0 1 1 0 (* fairness *) ] b � � � b = x n � 1 0 R S = Right shift with p as m.s.b p LS = Left shift with p as l.s.b. p a = numb er of leading zeros b = numb er of leading ones c � Vija y K. Ga rg Distributed Systems F all 94

  16. Rep eated Computation of a Global F unction 16 Algo rithm to �nd Current Minimum in the Net w o rk � Distributed b ranch and b ound � Distributed simulation � p ro cess x : step = 0 � [ dest msg ( x; step ) 6 = nil ! send msg ( dest msg ( x; step ) ; my min ) step := step + 1 sr c msg ( x; step ) 6 = nil ! r ecv msg ( sr c msg ( x; step ) ; hismin ) recompute my min step := step + 1 ] c � Vija y K. Ga rg Distributed Systems F all 94

  17. Rep eated Computation of a Global F unction 17 P erfo rmance of the Algo rithm � at most k messages handled b y a no de/time step � the global function G ( t ) is available at t + d log N e time steps. � a throughput of one global function p er times step. � numb er of messages required � half of that fo r static hiera rcy . � equal w o rkload distribution � Vija c y K. Ga rg Distributed Systems F all 94

  18. Rep eated Computation of a Global F unction 18 Extensions � General N - use virtual no des � General k - metho ds to generate p ermutation s fo r bina ry trees generaliz e to k -a ry trees. � asynchronous messages - can b e used instead o d synchronous messages. No des synchronize d due to \receives". c � Vija y K. Ga rg Distributed Systems F all 94

Recommend


More recommend