531/735 Programming Assignment 1 - 20032

Due Date: Friday, December 12, 2003

Purpose:
This programming assignment is designed to give you some experience programming in a SIMD environment.

The Game Of Life
The game of Life, invented by the mathematiciam John Conway, is intended to model life in a society of organisms. Consider a rectangular array of cells, each of which may contain an organism. If the array is considered to extend indefinitely in both directions, then each cell has eight neighbors, the eight cells surrounding it. (See Figure 1.) Births and deaths occur according to the following rules:

  1. An organism is born in any empty cell having exactly Num_to_be_born neighbors.
  2. An organism dies from isolation if it has fewer than Die_from_isolation neighbors.
  3. An organism dies from overcrowding if it has more than Die_from_overcrowding neighbors.
  4. All other organisms survive to the next generation.

Typical values of Num_to_be_born, Die_from_isolation, and Die_from_overcrowding are 3, 2, and 3, respectively.

.gif

Figure 1: A Cell (i,j) and its Eight Neighbors

If the array is bounded, edge cells will have fewer adjacent cells. However, the rules for births and deaths will not change. Figures 2 and 3 illustrate the typical Game of Life played on a 3 by 3 array of cells. "1" is used to represent occupied and "0" to represent empty.

.gif

Figure 2: Center Cell is Born

.gif

Figure 3: Center and West Cells Die From Overcrowding; Southeast From Isolation; East Cell is Born

Write a parallaxis program to play the game of Life and investigate the patterns produced by various initial configurations. (I should be able to specify an initial configuration for a 10 X 10 board, and the values of Num_to_be_born, Die_from_isolation, and Die_from_overcrowding in that order. These values should be followed by Generations, the number of generations to run.) In addition to tracking the life and death of each cell, for each generation give these three statistics: number of births, number of deaths, and total population. Assume the input data comes from standard input.

What To Submit:

The hardcopy should include:

  1. the Parallaxis program listing that you submitted.
  2. the program output using the input file, lab1.data found in /usr/local/pub/ncs/parallel/parallaxis/lab1data. Output generational data in the same format as the input is provided. Make sure generational data and statistics are labelled. Include a listing of the input data as generation 0.
  3. (5 points) a discussion of the considerations you gave in selecting your topology and algorithm. (Note: Topology consists of both processing elements and the interconnection network.) What goals were you trying to meet (e.g., maximize parallelism, minimize turnaround time, etc.)? What algorithm did you use?
  4. (10 points) an analysis of the algorithm providing a formula for speedup as a function of the number of processors, number of cells, and number of generations and then apply it to THIS problem. A discussion of applying Amdahl's law to this problem. What assumptions have you made? (Be explicit.) (HINT: Which is the game of life more like, FindMax or PeopleWave?)
  5. (10 points) a discussion of how programming this execise on a 64 node, 6-dimensional hypercube would affect your code. What are some of the issues which arise? How would you overcome them?

You are to electronically submit a directory called lab1dir using the following command:

or

depending on which course you are registered in.

This directory will contain the appropriate source file, a READ_ME file, if pertinent, and a makefile. Do not submit executable files. I should be able to create the executable by typing make. The name of the executable file created should be life.

The gradesheet I will used may be viewed here.


Nan C. Schaller
Rochester Institute of Technology
Computer Science Department
102 Lomb Memorial Dr.
Rochester, NY 14623-5608
telephone: +1.585.475.2139
fax: +1.585.475.7100
e-mail: ncs@cs.rit.edu
November 25, 2003
http://www.cs.rit.edu/~ncs/Courses/531/lab1.html