<!--#set var="root_directory" value="../../.." --><!--#include virtual="$root_directory/shared/header.shtml"-->
<h1>Assignment #4</h1>
-<p><em>Due Friday, October 23, 2009</em></p>
+<p><em>Due Friday, October 29, 2010</em></p>
<h2>Purpose</h2>
<p>Note: Please identify all your work.</p>
<p>This assignment consists in building your own broadcast code based
-on a binary tree. The code
+on a binary tree. The code
<a href="../../../content/global_operations/src/print_tree.c">print_tree.c</a>
-provides a simple implementation of a binary tree based on node zero
-as being the root. It generates the node numbers from which any node
-is to receive the information and to which to send this
-information.</p>
+(see <a href="../../../content/global_operations/">Global
+Operations</a>) provides a simple implementation of a binary tree
+based on node zero as being the root. It generates the node numbers
+from which any node is to receive the information and to which to send
+this information.</p>
<h2>Part A</h2>
syntax as <code>MPI_Bcast()</code>, namely</p>
<pre>
-int My Bcast(void *buffer, int count, MPI Datatype datatype, int root,
- MPI Comm comm)
+int My_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
+ MPI_Comm comm)
</pre>
<p>This function should be based on the skeleton
quoting this fact and return an exit code one (1).</p>
<p>Test your routine carefully for various process numbers and
-different count and datatype in the call.</p>
+different <code>count</code> and <code>datatype</code> in the
+call.</p>
<h2>Part B</h2>
<p>Broadcast 10,000 integers 100 times and take an average over the
100 broadcasts to smooth out the time fluctuations. Repeat for 10,000
-double. Tabulate your timings and comment on the results.</p>
+<code>double</code>. Tabulate your timings and comment on the
+results.</p>
<h2>Part C</h2>
<p>Modify <code>My_Bcast()</code> to be able to broadcast from any
process (the root process) within the virtual machine. Check your code
-carefully for different <em>root</em> processes and various number of
-processes.</p>
+carefully for different <code>root</code> processes and various numbers
+of processes.</p>
<!--#include virtual="$root_directory/shared/footer.shtml"-->
--- /dev/null
+<!--#set var="root_directory" value="../../.." --><!--#include virtual="$root_directory/shared/header.shtml"-->
+
+<h1>Assignment #4</h1>
+<p><em>Due Friday, October 23, 2009</em></p>
+
+<h2>Purpose</h2>
+
+<p>Learn how to implement a truly parallel algorithm.</p>
+
+<p>Note: Please identify all your work.</p>
+
+<p>This assignment consists in building your own broadcast code based
+on a binary tree. The code
+<a href="../../../content/global_operations/src/print_tree.c">print_tree.c</a>
+provides a simple implementation of a binary tree based on node zero
+as being the root. It generates the node numbers from which any node
+is to receive the information and to which to send this
+information.</p>
+
+<h2>Part A</h2>
+
+<p>Write a function <code>My_Bcast()</code> that performs a broadcast
+similar as the one provided by MPICH2. It should follow the same
+syntax as <code>MPI_Bcast()</code>, namely</p>
+
+<pre>
+int My_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
+ MPI_Comm comm)
+</pre>
+
+<p>This function should be based on the skeleton
+code <code>print_tree.c</code>. It should therefore assume that root
+is process zero (0). If not, it should print out an error message
+quoting this fact and return an exit code one (1).</p>
+
+<p>Test your routine carefully for various process numbers and
+different count and datatype in the call.</p>
+
+<h2>Part B</h2>
+
+<p>Instrument your code for timing measurements. Modify your main code
+to broadcast the information three (3) different ways:</p>
+
+<ol>
+ <li>sequentially via a for loop,</li>
+ <li>via your <code>My_Bcast()</code>, and</li>
+ <li>via the MPICH2 <code>MPI_Bcast()</code>.</li>
+</ol>
+
+<p>Broadcast 10,000 integers 100 times and take an average over the
+100 broadcasts to smooth out the time fluctuations. Repeat for 10,000
+double. Tabulate your timings and comment on the results.</p>
+
+<h2>Part C</h2>
+
+<p>Modify <code>My_Bcast()</code> to be able to broadcast from any
+process (the root process) within the virtual machine. Check your code
+carefully for different <em>root</em> processes and various number of
+processes.</p>
+
+<!--#include virtual="$root_directory/shared/footer.shtml"-->