Purpose: The purpose of this assignment is to program a distributed memory parallel program problem that uses synchronized computation in its solution.
Guidelines:
This assignment is to be done on your own. You may not work with other students in the class. You may use materials from the texts and outside readings. Looking at pseudocode solutions from textbooks is OK. However, it is cheating to look up the specific solution to this problem on the web or another resource. You may use any code given in the class or from the text as a starting point. You may also want to visit the simulations at the Shodor Foundation, for fun.
Program Specifications:
Section 6.3.3 of the Wilkinson text describes cellular automata. According to the text, the most famous cellular automata is the "Game of Life" devised by John Horton Conway, a Cambridge mathematician. To prepare, read this section of the text
Option 1: the Game of Life
For the Game of Life program, I would like for you to write an MPI program that simulates a two-dimensional cellular automaton. Use the rules from the Game of Life, but try to write your program in such a way that you could change the rules and your program would still work. Although this is quite inefficient from an MPI perspective, I would like for your program to output the pattern of the board after every generation. It's more interesting this way!
One way to write your program is to have the input for your program come from a file. Several sample files are provided for you to test the Game of Life program:
Option 2: Fire!
For the Fire! program, I would like for you to write an MPI program that simulates a two-dimensional cellular automaton. You may use rules that are found in the simulation of Fire at the Shodor Foundation, or you may make up your own. Include at the top of the program a set of comments that describes in detail the rules that your simulation will use. As with the Game of Life, you may have your initial data come from a file, or you may prefer to use a command line parameter to input the coordinate of the tree that will catch on fire first, and the probability that a neighbor tree will catch on fire.
Option 3: Sharks and Fish
For the Sharks and Fish program, I would like for you to write an MPI program that
simulates a two-dimensional cellular automaton. You may use rules that are found
in section 6.3.3 of Wilkinson, but you may need to provide some more
detail for completeness.
Include at the
top of the program a set of comments that describes in detail
the rules that your simulation will use.
As with the Game of Life, you may have your initial data come from a
file, or you may prefer to initialize the grid using a random
set of sharks and fish. If you use an input data file be sure
that you provide a sample set of data for testing your program.
Be sure that your comments section of your program describes how to
run your program, and also provide a
Option 4: Foxes and Rabbits
For the Foxes and Rabbits program, I would like for you to write an MPI program that
simulates a two-dimensional cellular automaton. You may use rules that are found
in section Problem 6-21 of Wilkinson, but you may need to provide some more
detail for completeness.
Include at the
top of the program a set of comments that describes in detail
the rules that your simulation will use.
As with the Game of Life, you may have your initial data come from a
file, or you may prefer to initialize the grid using a random
set of foxes, rabbits, and grass. If you use an input data file be sure
that you provide a sample set of data for testing your program.
Be sure that your comments section of your program describes how to
run your program, and also provide a
Grading:
The program that you write should compile and run on the Prospero
Linux cluster.
If you choose to write in a language other than C, then
you must provide me with the compile line or makefile for the
program, and it must run on Linux.
For full
credit your program must
compile without errors or warnings, and must execute correctly
with a variety of test cases. It should catch simple errors. It
should have
adequate comments and use good software engineering style and
techniques.
Undergraduates: For full credit, your program must run
correctly for at least two processes.
Graduates: For full credit, your program must run correctly for an arbitrary
number of processes, assumed to be not greater than the number of
rows in the matrix, and assumed to evenly divide the number of rows
in the matrix.
You will receive 85% credit if your program runs correctly for
exactly two processes.
Option Selection: The options are not equally difficult and
there is much opportunity for extra functionality. Extra
credit will be given for selection of a more difficult
options and/or for additional functionality in your
program. The Game of Life is worth at most 95% credit.
What you turn in:
Enjoy!