-<ol>
- <li>Build a broadcast function based on the skeleton code
- <a href="src/print_tree.c">print_tree.c</a>.</li>
- <li>Call this function <code>my_broadcast()</code> with a calling
- sequence
- <pre>int my_broadcast( int my_rank, int size, int root, double *msg, int count )</pre>
- In other words, restrict it to only <code>double</code> data type for
- simplicity and to <code>root</code> pointing to node 0 only (via
- an <code>if ( )</code>).</li>
- <li>Move the inner parts of the loop
- in <a href="src/print_tree.c">print_tree.c</a> over to a function
- <code>my_broadcast</code> (still in a serial code).</li>
- <li>Use an integer array <code>target[]</code> created by
- <code>malloc()</code> to store the list of <code>to</code> target
- nodes.</li>
- <li>Include the MPI administrative calls
- (<code>MPI_Init()</code>,
- <code>MPI_Comm_size()</code>,
- <code>MPI_Comm_rank()</code>,
- <code>MPI_Finalize()</code>), and use the actual <code>size</code> and
- <code>rank</code> of the virtual machine instead for the loop
- over <code>rank</code>.</li>
- <li>Implement the send and receive routines (<code>MPI_Recv()</code> and
- <code>MPI_Ssend()</code>) to receive and transmit the message.</li>
- <li>Put <code>printf()</code> statements in the main program to
- check that the code is working correctly.</li>
-</ol>