ArticleslgStudy

computer science

Broadcast (parallel pattern)

Broadcast (parallel pattern) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Broadcast (parallel pattern) rather than just read about it. In short: Broadcast is a collective communication primitive in parallel programming to distribute programming instructions or data to nodes in a cluster. It is the reverse operation of reduction.

Broadcast (parallel pattern) — main illustration
Broadcast (parallel pattern) — illustration

Key takeaways

  • Broadcast (parallel pattern) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Broadcast (parallel pattern) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Broadcast (parallel pattern) from memory before moving on to harder problems.

Reference excerpt

Broadcast is a collective communication primitive in parallel programming to distribute programming instructions or data to nodes in a cluster. It is the reverse operation of reduction. The broadcast operation is widely used in parallel algorithms, such as matrix-vector multiplication, Gaussian elimination and shortest paths. The Message Passing Interface implements broadcast in MPI_Bcast.

Definition A message M[1..m] of length m should be distributed from one node to all other p−1 nodes. Tbyte is the time it takes to send one byte. Tstart is the time it takes for a message to travel to another node, independent of its length. Therefore, the time to send a package from one node to another is t=size×Tbyte+Tstart. p is the number of nodes and the number of processors.

Binomial Tree Broadcast

With Binomial Tree Broadcast the whole message is sent at once. Each node that has already received the message sends it on further. This grows exponentially as each time step the amount of sending nodes is doubled. The algorithm is ideal for short messages but falls short with longer ones as during the time when the first transfer happens only one node is busy. Sending a message to all nodes takes log2(p)t time which results in a runtime of log2(p)(mTbyte+Tstart)

Linear Pipeline Broadcast

The message is split up into k packages and sent piecewise from node n to node n+1. The time needed to distribute the first message piece is pt=mkTbyte+Tstart whereby t is the time needed to send a package from one processor to another. Sending a whole message takes (p+k)(mTbytek+Tstart)=(p+k)t=pt+kt. Optimal is to choose k=m(p−2)TbyteTstart resulting in a runtime of approximately mTbyte+pTstart+mpTstartTbyte The run time is dependent on not only message length but also the number of processors that play roles. This approach shines when the length of the message is much larger than the amount of processors.

Pipelined Binary Tree Broadcast

This algorithm combines Binomial Tree Broadcast and Linear Pipeline Broadcast, which makes the algorithm work well for both short and long messages. The aim is to have as many nodes work as possible while maintaining the ability to send short messages quickly. A good approach is to use Fibonacci trees for splitting up the tree, which are a good choice as a message cannot be sent to both children at the same time. This results in a binary tree structure. We will assume in the following that communication is full-duplex. The Fibonacci tree structure has a depth of about d≈logΦ(p) whereby Φ=1+52 the golden ratio. The resulting runtime is (mkTbyte+Tstart)(d+2k−2). Optimal is k=n(d−2)Tbyte3Tstart. This results in a runtime of 2mTbyte+TstartlogΦ(p)+2mlogΦ(p)TstartTbyte.

Two Tree Broadcast (23-Broadcast)

Definition This algorithm aims to improve on some disadvantages of tree structure models with pipelines. Normally in tree structure models with pipelines (see above methods), leaves receive just their data and cannot contribute to send and spread data. The algorithm concurrently uses two binary trees to communicate over. Those trees will be called tree A and B. Structurally in binary trees there are relatively more leave nodes than inner nodes. Basic Idea of this algorithm is to make a leaf node of tree A be an inner node of tree B. It has also the same technical function in opposite side from B to A tree. This means, two packets are sent and received by inner nodes and leaves in different steps.

Tree construction

The number of steps needed to construct two parallel-working binary trees is dependent on the amount of processors. Like with other structures one processor can is the root node who sends messages to two trees. It is not necessary to set a root node, because it is not hard to recognize that the direction of sending messages in binary tree is normally top to bottom. There is no limitation on the number of processors to build two binary trees. Let the height of the combined tree be h = ⌈log(p + 2)⌉. Tree A and B can have a height of h−1. Especially, if the number of processors correspond to p=2h−1, we can make both sides trees and a root node. To construct this model efficiently and easily with a fully built tree, we can use two methods called "Shifting" and "Mirroring" to get second tree. Let assume tree A is already modeled and tree B is supposed to be constructed based on tree A. We assume that we have p processors ordered from 0 to p−1.

Shifting

The "Shifting" method, first copies tree A and moves every node one position to the left to get tree B. The node, which will be located on -1, becomes a child of processor p−2.

Mirroring

"Mirroring" is ideal for an even number of processors. With this method tree B can be more easily constructed by tree A, because there are no structural transformations in order to create the new tree. In addition, a symmetric process makes this approach simple. This method can also handle an odd number of processors, in this case, we can set processor p−1 as root node for both trees. For the remaining processors "Mirroring" can be used.

Coloring We need to find a schedule in order to make sure that no processor has to send or receive two messages from two trees in a step. The edge, is a communication connection to connect two nodes, and can be labelled as either 0 or 1 to make sure that every processor can alternate between 0 and 1-labelled edges. The edges of A and B can be colored with two colors (0 and 1) such that

no processor is connected to its parent nodes in A and B using edges of the same color- no processor is connected to its children nodes in A or B using edges of the same color. In every even step the edges with 0 are activated and edges with 1 are activated in every odd step.

Time complexity In this case the number of packet k is divided in half for each tree. Both trees are working together the total number of packets k=k/2+k/2 (upper tree + bottom tree) In each binary tree sending a message to another nodes takes 2i steps until a processor has at least a packet in step i. Therefore, we can calculate all steps as d:=log2(p+1)⇒log2(p+1)≈log2(p). The resulting run time is T(m,p,k)≈(mkTbyte+Tstart)(2d+k−1). (Optimal k=m(2d−1)Tbyte/Tstart) This results in a run time of T(m,p)≈mTbyte+Tstart⋅2log2(p)+m⋅2log2(p)TstartTbyte.

… excerpt ends here. Continue reading the full article.

Illustrations

Broadcast (parallel pattern): Pipeline Broadcast
Pipeline Broadcast
Broadcast (parallel pattern): Pipelined Binary Tree Broadcast
Pipelined Binary Tree Broadcast
Broadcast (parallel pattern): Visualization of Two Tree Broadcast
Visualization of Two Tree Broadcast
Broadcast (parallel pattern): Examples of tree structures depending on the number of processors
Examples of tree structures depending on the number of processors
Broadcast (parallel pattern): Tree construction using "Shifting"
Tree construction using "Shifting"

Worked examples

Example 1 — a first encounter with Broadcast (parallel pattern)

Start with the simplest possible case. Write down what Broadcast (parallel pattern) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Broadcast (parallel pattern) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Broadcast (parallel pattern) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Broadcast (parallel pattern)

In research
Broadcast (parallel pattern) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Broadcast (parallel pattern) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Broadcast (parallel pattern) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Algorithms, Parallel computing, so understanding it makes those chapters shorter.
In everyday life
Look for Broadcast (parallel pattern) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Broadcast (parallel pattern)” →

How to study Broadcast (parallel pattern) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Broadcast (parallel pattern) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Broadcast (parallel pattern) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Broadcast (parallel pattern) in simple terms?

Broadcast is a collective communication primitive in parallel programming to distribute programming instructions or data to nodes in a cluster. It is the reverse operation of reduction.

Why does Broadcast (parallel pattern) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Broadcast (parallel pattern)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Broadcast (parallel pattern).

Tags

  • Algorithms
  • Parallel computing

Keep exploring