<!--#set var="root_directory" value="../../.." --><!--#include virtual="$root_directory/shared/header.shtml"-->
-<h1>Assignment #5</h1>
-<p><em>Due Friday, November 16, 2007</em></p>
-
-<h2>Purpose:</h2>
-
-<p>To learn parallel coding and the MPE graphics environment.</p>
-
-<h2>Setup</h2>
-
-<p>This assignment consists in implementing and displaying the
-Mandelbrot Set in parallel.</p>
+<h1>Assignment #6</h1>
+<p><em>Due Friday, November 5, 2009</em></p>
+
+<h2>Purpose</h2>
+
+<p>Learn how to implement a hostless parallel algorithm.</p>
+
+<p>Note: Please identify all your work.</p>
+
+<p>This assignment consists in rewriting the code calculating the
+Mandelbrot Set in a static load balance approach using a hostless
+parallel algorithm.</p>
+
+<p>In a hostless parallel algorithm, <em>all</em> nodes are treated on
+the same basis, except possibly for a brief dialogue with the user to
+start with and some post-processing of the data at the end of the
+calculation by node 0. In general, this paradigm is simpler to code
+than a master-slave approach. But it requires to find a way to divide
+the problem in parcels of equal complexity, therefore taking
+equivalent time to compute.</p>
+
+<p>In the Mandelbrot Set adjacent lines of pixels in the image ought
+to take comparable times to compute. Therefore a static load balance
+algorithm follows by requesting the nodes (including node 0 —
+therefore a hostless algorithm) to calculate the lines in the image on
+a cyclic basis. For instance, if three (3) nodes are used, each node
+should compute the lines of pixels according to the following
+table:</p>
+
+<table>
+ <tr><th>node</th><th>lines</th></tr>
+ <tr><td>0</td> <td>0, 3, 6, 9, ...</td></tr>
+ <tr><td>1</td> <td>1, 4, 7, 10, ...</td></tr>
+ <tr><td>2</td> <td>2, 5, 8, 11, ...</td></tr>
+</table>
<h2>Part A</h2>
-<p>Parallelize the Mandelbrot Set. To do so use a model in which all
-the processes, except rank 0, perform the same operations. Let rank 0
-process set the parameters, launch the calculation in
-the <code>size-1</code> other worker processes, collect the data and
-print out the data to form the image.</p>
-
-<p>The algorithm to follow for each worker processes is to calculate
-alternate "horizontal" lines (parallel to Creal) modulo their
-rank. For example, in a <code>size=4</code> processes parallel system,
-process 1 would compute lines 0, 3, 6, .., while process 2 would
-compute lines 1, 4, 7, ... and process 3 would compute lines 2, 5, 8,
-... In doing so one would hope to have approximately the same load in
-each worker process on average. This is a static load balance
-model.</p>
+<p>Write a code to</p>
-<p>Call the code <code>MS_static_load.c</code>.</p>
+<ul>
+ <li>implement the hostless approach.</li>
+ <li>produce the Mandelbrot Set image by piping the data in plot
+ image.py.</li>
+ <li>reproduce the same image as the serial and master-slave versions
+ from the notes in the web pages.</li>
+ <li>handle an arbitrary number of nodes.</li>
+ <li>handle an arbitrary size for the image (default: 700x500).</li>
+</ul>
<h2>Part B</h2>
-<p>Modify the code in part A to use the MPE graphics package to
-display the Mandelbrot Set directly from each worker process. Call
-this code <code>MS_static_load_mpe.c</code>.</p>
-
-<h2>Part C</h2>
+<p>Include timing calls in your code to prove (or disprove) the
+assumption that the approach described above really leads to a proper
+load balance. Quantify the time variations in the nodes when using
+from 2 to 16 nodes.</p>
-<p>Modify the code in part B to use the MPE graphics package to pick
-up new a zoomed section of the Mandelbrot Set via two mouse clicks to
-define a selected area of the image and calculate anew the Mandelbrot
-Set in this expanded area. This requires
-using <code>MPE_Get_mouse_press()</code> from within an event loop
-from within process 0. Please think of a way to stop this zooming
-other than <code>CTRL-C</code>. Call this code
-<code>MS_static_load_zoom.c</code>.</p>
+<p>You could solve this assignment
+on <code>borg0.physics.drexel.edu</code>.</p>
<!--#include virtual="$root_directory/shared/footer.shtml"-->
--- /dev/null
+<!--#set var="root_directory" value="../../.." --><!--#include virtual="$root_directory/shared/header.shtml"-->
+
+<h1>Assignment #5</h1>
+<p><em>Due Friday, November 16, 2007</em></p>
+
+<h2>Purpose:</h2>
+
+<p>To learn parallel coding and the MPE graphics environment.</p>
+
+<h2>Setup</h2>
+
+<p>This assignment consists in implementing and displaying the
+Mandelbrot Set in parallel.</p>
+
+<h2>Part A</h2>
+
+<p>Parallelize the Mandelbrot Set. To do so use a model in which all
+the processes, except rank 0, perform the same operations. Let rank 0
+process set the parameters, launch the calculation in
+the <code>size-1</code> other worker processes, collect the data and
+print out the data to form the image.</p>
+
+<p>The algorithm to follow for each worker processes is to calculate
+alternate "horizontal" lines (parallel to Creal) modulo their
+rank. For example, in a <code>size=4</code> processes parallel system,
+process 1 would compute lines 0, 3, 6, .., while process 2 would
+compute lines 1, 4, 7, ... and process 3 would compute lines 2, 5, 8,
+... In doing so one would hope to have approximately the same load in
+each worker process on average. This is a static load balance
+model.</p>
+
+<p>Call the code <code>MS_static_load.c</code>.</p>
+
+<h2>Part B</h2>
+
+<p>Modify the code in part A to use the MPE graphics package to
+display the Mandelbrot Set directly from each worker process. Call
+this code <code>MS_static_load_mpe.c</code>.</p>
+
+<h2>Part C</h2>
+
+<p>Modify the code in part B to use the MPE graphics package to pick
+up new a zoomed section of the Mandelbrot Set via two mouse clicks to
+define a selected area of the image and calculate anew the Mandelbrot
+Set in this expanded area. This requires
+using <code>MPE_Get_mouse_press()</code> from within an event loop
+from within process 0. Please think of a way to stop this zooming
+other than <code>CTRL-C</code>. Call this code
+<code>MS_static_load_zoom.c</code>.</p>
+
+<!--#include virtual="$root_directory/shared/footer.shtml"-->