CSCI 3366 (Introduction to Parallel and Distributed Processing), Spring 2009:
Homework 3

Assigned:
March 24, 2009.

Due:
April 2, 2009, at 5pm. Revised due date: April 21.

Credit:
40 points.

Overview

Your mission for this assignment is write a parallel version of mathematician John Conway's ``Game of Life'', as described briefly in class March 25. (You can also find more information on the Web. The Wikipedia article seems good.)

The Game of Life is not so much a game in the usual sense as a set of rules for a cellular automaton -- there are no players, and once the initial configuration is established, everything that happens is determined by the game's rules. The game is ``played'' on a rectangular grid of cells. Some cells are ``live'' (contain a simulated organism); others are ``dead'' (empty). At each time step, a new configuration is computed from the old configuration according to the following rules:

Details

Sequential starter program

To help you get started, I wrote a sequential C program with a simple text interface. Here it is, with the part of the program that actually does the calculations removed (but all the tedious stuff to get input and print output left in):

You don't have to use this code, but it does illustrate one approach to dealing with 2D arrays in C (simulating them with 1D arrays). You might find it useful to start by filling in the parts of the code I left out and running the result a few times, to test that you understand how to do the computational part of the game. Comments in the code explain the command-line parameters and input file format, which let you choose between completely specifying the initial board configuration (reasonable for small problems) and having one generated at random (more useful for testing whether multiple UEs actually help). Or you might choose to start from scratch. If you do, and you choose a different user interface, be sure to include comments in/with your program that explain how to run your program.

Parallel programs

Your mission is to write two parallel versions of this application, one for distributed memory (e.g., using MPI) and one for shared memory (e.g., using OpenMP -- though you could rewrite in Java if you insist). Both parallel programs should produce exactly the same results as the original sequential program (except for timing information).

Performance of parallel programs

Once you have working parallel code, experiment with input values until you get a problem size/configuration big enough to make it reasonable to hope for good speedups with multiple UEs. (Think a little about what will affect this most -- size of board, number of steps, interval between printing results.) Then time your two parallel programs for this problem size/configuration and different numbers of UEs and plot the results, as in Homework 2.

What to turn in and how

Turn in the following:

Submit source code and other files by sending mail to bmassing@cs.trinity.edu, with each file as an attachment. Please use a subject line that mentions the course number and the assignment (e.g., ``csci 3366 homework 3''). You can develop your programs on any system that provides the needed functionality, but I will test them on one of the department's Fedora 9 Linux machines, so you should probably make sure they work in that environment before turning them in.



Berna Massingill
2009-04-16