1 / 105

Broadcast and scatter algorithms on mesh-based topologies

Broadcast and scatter algorithms on mesh-based topologies . Lecture outline. Model definition and lower bounds One-to-All Broadcast algorithm on hypercube All-to-All Broadcast algorithm on hypercube One-to-All Scatter algorithm on hypercube All-to-All Scatter algorithm on hypercube

mateo
Télécharger la présentation

Broadcast and scatter algorithms on mesh-based topologies

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. Broadcast and scatter algorithms on mesh-based topologies

  2. Lecture outline • Model definition and lower bounds • One-to-All Broadcast algorithm on hypercube • All-to-All Broadcast algorithm on hypercube • One-to-All Scatter algorithm on hypercube • All-to-All Scatter algorithm on hypercube • Broadcast algorithms on torus

  3. Model definition • Ports number (1-port, k-port, all-port) • Directedness of channels (simplex, • half-duplex, full-duplex) • Switching technique (store-and-forward (SF) or wormhole (WH)) • Packet manipulation capability (combining model , noncombining model, intermediate reception capability )

  4. Lower bounds for basic communication algorithms on hypercube All-port, full-duplex, SF model

  5. Lower bounds for basic communication algorithms on hypercube • O-A-B cannot take less rounds than is the value of the diameter. Since the broadcast packet has to be delivered to distinct nodes, the number of transmissions is at least. • During A-A-B, each node has to receive distinct packets. Node can receive at mostdpackets in one round (on all its d links). Thus, at least rounds are needed, and the number of transmissions is at least times the number of transmissions of one O-A-B - . • During O-A-S, the source has to send the total of distinct packets and it can send at most dpackets in one round. There is nodes of the distancekfrom the source. The number of transmissions cannot be less than. • A-A-S consists of O-A-Ss running concurrently. So, the number of transmissions is . Every round at most packets can be delivered on hypercube. Thus it will take at least rounds.

  6. Basic communication algorithms on hypercube • The idea – building minimal-weight spanning tree, rooted at broadcasting/scattering node. • Generally, building minimal-weight spanning tree on hypercube is easy task. • In scatter algorithms the tree must be balanced.

  7. One-to-All Broadcast algorithm on hypercube

  8. One-to-All Broadcast algorithm on hypercube • The idea: At every round k communication only on k-dimension links. • The Algorithm (for any node i) : • toSend = true; Msg contains value - for broadcasting node, toSend = false; Msg is null - for all other nodes • At round k do: • If toSend = true then send Msg on link k • Else if received message M` then • Msg  M` • toSend  true • End of round

  9. One-to-All Broadcast algorithm on hypercube k=0 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  10. One-to-All Broadcast algorithm on hypercube k=1 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  11. One-to-All Broadcast algorithm on hypercube k=2 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  12. One-to-All Broadcast algorithm on hypercube k=3 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  13. One-to-All Broadcast algorithm on hypercube k=4 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  14. One-to-All Broadcast algorithm on hypercube k=4 , End of round d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  15. One-to-All Broadcast algorithm on hypercube • The kind of such built tree is called, d-level spanning binomial tree – • Complexity analysis: • # of rounds: d • # of transmissions: • The algorithm is optimal! • Note: The algorithm didn't assume all-port, full-duplex model. So, the algorithm on 1-port, half-duplex model satisfies lower bound of all-port, full-duplex model.

  16. All-to-All Broadcast algorithm on hypercube

  17. All-to-All Broadcast algorithm on hypercube • The start: Every node builds its spanning tree. Denote by – spanning tree for node i ( root of is i). The tree consists of sequence of disjoint sets of directed links , where: • q – number of rounds to broadcast packet on • is set of links on which occurs transmission of a packet at round k. • Actually, the sequence defines algorithm for broadcasting packet from node i .

  18. All-to-All Broadcast algorithm on hypercube k=0 d=3 (000) (001) (100) (101) (000) (011) (010) (111) (110)

  19. All-to-All Broadcast algorithm on hypercube k=1 d=3 (000) (001) (001) (100) (101) (000) (011) (010) (100) (111) (110)

  20. All-to-All Broadcast algorithm on hypercube k=2 d=3 (000) (001) (001) (101) (100) (101) (000) (010) (011) (010) (100) (110) (111) (110)

  21. All-to-All Broadcast algorithm on hypercube k=3 d=3 (000) (001) (001) (101) (111) (100) (101) (000) (010) (011) (011) (010) (100) (110) (111) (110)

  22. All-to-All Broadcast algorithm on hypercube d=3 k=3, End of round (000) (001) (001) (101) (111) (100) (101) (000) (010) (011) (011) (010) (100) (110) (111) (110)

  23. All-to-All Broadcast algorithm on hypercube • Denote by T spanning tree with root in and accordingly. • Lemma: For every node t, the sequence of sets defines algorithm for broadcasting packet from node t(proof based on fact that and differ in a particular bit if and only if x and y differ on the same bit, so is a link if and only if (x,y) is a link).

  24. All-to-All Broadcast algorithm on hypercube (001) (101) (111) (000) (010) (011) (100) (110) (011) (111) (101) (010) (000) (001) (110) (100)

  25. All-to-All Broadcast algorithm on hypercube • In order to broadcast simultaneously, for every two trees next property should hold: (*)

  26. All-to-All Broadcast algorithm on hypercube • Now we show how to construct such that will hold property (*). • Definition: A link(x,y) is of typej if x and y differ in the j-th bit. • Observation: If for each k, the links in are of different types, then for each k, the sets , where t ranges over all nodes, are disjoint. (if for , links and were from the same type, then (since ), and they would be of the same type because and are of the same type as and respectively  contradicts the fact that and both belongs to ) • Conclusion: We need to construct such that for every i, the links in are off different types.

  27. All-to-All Broadcast algorithm on hypercube • Step I: Dividing: • Define as a set of d-bit length nodes having k unity bits and d-k zero bits. • For each set define disjoint subsets which are equivalence classes under single bit rotation to the left. • For each k, is the equivalence class of the element .

  28. All-to-All Broadcast algorithm on hypercube Division of space {0,..,31}

  29. All-to-All Broadcast algorithm on hypercube • Step II: Numbering: • For each node t associate distinct number n(t) in next order: • Define sequence of numbers . Thus, m(t) that corresponding to sequence n(t) is d,1,2,..,d,1,2…

  30. All-to-All Broadcast algorithm on hypercube Numbering of space {0,..,31}

  31. All-to-All Broadcast algorithm on hypercube • Step III: Ordering: • Every first element t in must fulfill: the bit in position m(t) from the right should be 1 • Every element t in must fulfill: the bit in position m(t)-1 [m(t)>1] or d [m(t)=1] from the right should be 0

  32. All-to-All Broadcast algorithm on hypercube • Step IV: Constructing : • For ,define node sets: • For each set consists of the links, that connect nodes with corresponding nodes in obtained from t by reversing the bit in position m(t). (In particular, nodes in set connected to corresponding nodes in because of ordering)

  33. All-to-All Broadcast algorithm on hypercube • Step V: Building routing table (for node k): • In routing table: rows = rounds, columns = links. • Every entry contains only source node. • Every row i constructed from set by creating entry x at column for every link (x,y). • In first row the source is k itself and the destination nodes are k-th neighbors.

  34. All-to-All Broadcast algorithm on hypercube m(0001)=1 m(1001)=4 m(1101)=3 m(0010)=2 m(0011)=1 m(1011)=4 m(1111)=3 (0000) m(0100)=3 m(0110)=2 m(0101)=1 m(0111)=1 m(1000)=4 m(1100)=3 m(1010)=2 m(1110)=2

  35. All-to-All Broadcast algorithm on hypercube Routing table:

  36. All-to-All Broadcast algorithm on hypercube k=0 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  37. All-to-All Broadcast algorithm on hypercube k=1 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  38. All-to-All Broadcast algorithm on hypercube k=2 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  39. All-to-All Broadcast algorithm on hypercube k=3 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  40. All-to-All Broadcast algorithm on hypercube k=4 d=4 (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  41. All-to-All Broadcast algorithm on hypercube d=4 k=4, End of round (0000) (1000) (1100) (0100) (0101) (1001) (1101) (0001) (0110) (1010) (1110) (0010) (0011) (1011) (0111) (1111)

  42. All-to-All Broadcast algorithm on hypercube Algorithm (for any node i): • At the initialization: • Build routing table as shown before • Put d packets into queue (packet header include source and destination nodes). • At round k do: • Send all messages in queue that should be sent according to the routing table. • Receive messages and put them into queue • End of round

  43. All-to-All Broadcast algorithm on hypercube • Complexity analysis: • Every one of the sets has exactly d elements. Also .Therefore • # of rounds: • # of transmissions: • The algorithm is optimal! • Note:We didn't prove correctness of building • contains links only of different types (for every k) • every link holds (for every k) – actually, we have to prove only that

  44. One-to-All Scatter algorithm on hypercube

  45. One-to-All Scatter algorithm on hypercube • Observation I: A-A-B and O-A-S problems are similar, but here we need to build for scattering node balanced spanning tree: On first level d sub-trees, with size at most . • Observation II: For any tree T with roott, of size n, scatter problem via single link to root, resolved in n rounds (by giving priority to furthest nodes).

  46. One-to-All Scatter algorithm on hypercube • Definition: class is compatible with class if has d nodes and there exist two nodes . , such that is obtained from . by reversing some unity bit of to zero bit. • Observation III: For every class there exists a compatible class . (Take any node whose rightmost bit is a 1, and leftmost bit is a 0. Let s be string of consecutive zeros with maximal number of bits and let be the node obtained from by reversing the unity bit immediately to the right of s. Then, the equivalence class of is compatible with )

  47. One-to-All Scatter algorithm on hypercube • Algorithm for scattering node (0,..,0) : • Steps I-II as in A-A-Broadcastalgorithm. • Step IV: Constructing Spanning Tree: • Start with empty tree T (only nodes). • Add to T links, connecting (0,..,0) with all the nodes in . The first node in is chosen arbitrarily. • For each class (in ascending order) find its compatible class and add corresponding links to the tree T. • Add to T links, connecting (1,..,1) with all the nodes in .

  48. One-to-All Scatter algorithm on hypercube • Observation IV: For any we have where and can be obtained from by reversing some unity of to 0. • Conclusion: Each node x (except (0,..,0)) is in the sub-tree . Since there are at most nodes x having the same value m(x), each sub-tree contains at most nodes. Therefore tree T is balanced

  49. One-to-All Scatter algorithm on hypercube Algorithm (for scattering node i): • Node i: • At the initialization: • Build spanning tree. • Distribute tree structure (optional). • At round k do: • On every link l send message to node at distance q-k on the sub-tree . (q = ) • End of round

  50. One-to-All Scatter algorithm on hypercube Algorithm (for scattering node i): • Any other node j: • At the initialization: • Receive and forward tree structure (optional). • At any round do: • On receiving message: store (if message target = j), or forward according to spanning tree structure. • End of round

More Related