CS 480 Introduction to Parallel Computing

Fall 1999

Programming Assignment #3

Due:   10/9 5 pm.

B Level  42    A-Level 50 points.

Goals:

IMPORTANT: for compatability with the createBitmapFile program your array of pixels should be declared:   char  image[1024][1024];

You are encouraged to work in teams of two (2, II, zwei, dos ....)

Problem: Computing the Mandelbrot set

Write a parallel application using PVM to compute the portion of the Mandelbrot set within a user specified rectangular region of the complex plane.   The application should allow the user to specify the following parameters from the command line (in the order shown)

$ pvmmandel N xmin xmax ymin ymax maxiter

where:
N is the number of processes to spawn
xmin, ymin, ymin, ymax define the boundary of the rectangular region in the complex plane.
Maxiter is the maximum number of iterations to execute the computation loop.

Assume a fixed screen size: 1024 x 1024 pixels

Each group will be assigned a decomposition method from the table below.
 
Decomposition method
A
Dynamic task assignment.  Granularity: single pixel. Master will send information for a single pixel to a slave.  Slave will determine if point is in the set or not and return this information to the master
B
Dynamic task assignment. Granularity: an entire row of pixels. Master will send information for an entire row of pixels to a slave.  Slave will determine if specified points are in the set or not and return this information to the master. When a slave finishes, master will send it more work (if any remains).
C
Static task assignment.  Granularity:  1/Nth of the pixels.  For example, since there are 1024 rows, you could simply decide to divide 1024 by N and send the first N-1 slaves 1024/N rows and the remainder to the last slave ( you could also have the master do the remainder - but that's a bit more complicated)
 

In each case, you will need to determine what information the slave and master need to exchange and the sequence of pvm calls needed.

Notes:

Some coding details.

Declare an array   char matrix[1024][1024] to store your pixel values.  Use 1 to mean the pixel is white and 0 to mean the pixel is black (that is: in the mandelbrot set).      Ambitious teams may wish to include color: either at the X-windows or file format level.  ( try  "man IFL" on the sci- machines )

A sample program that uses X-windows is available in the alpha class library.  To compile this program enter:
 cc mandel.c -lX11 -o mandel
 

A-Level


To qualify for A level credit you must exceed the requirements listed above.  Any of the following would be adequate:

Submit via email to the instructor:

a document explaining:
the decomposition approach you used
PVM message content issues
speedup results
1 image file ( if  program does not use X-windows )
the parameters used for the submitted BMP file
Appendix (source files)




Last modified:9/30/99
Author: G.Zimmerman