9. Parallelize game of life
Completion requirements
Opened: Sunday, 29 March 2026, 12:00 AM
Due: Sunday, 5 April 2026, 11:59 PM
In this assignment, you will parallelize a given serial solution to assignment 7 (the optimized two-dimensional Game of Life), and assess its scaling performance.
Your assignment is as follows:
- First, git clone /home/l/lcl_uotphy1610/lcl_uotphy1610s1466/gameoflifeomp. Then
'cd gameoflifeomp', 'source setupmodules' and 'make BUILD=debug' will create 'gameoflife'. Use the debug build, which has "-O0", to better see the effects of paralleization. - As before, the code will accept command line arguments. The first and second parameters are the dimensions of the grid, the third parameter is the number of time steps, and the fourth is the initial fraction of alive cells. The final argument is the output file.
- From assignment 7, you know the bottlenecks are in the output_cells and update_cells functions.
- Paralelize the costly loops in the program with OpenMP. Make sure to adapt the Makefile to include the openmp flags.
- Write a single job script for the teach cluster that will run the parallelized gameoflife code with parameters "2000 2000 2000 0.183 output.txt" for 1, 2, 3, etc. up to 16 threads. The script (or the code itself) should time these calculations and store them in a table of thread numbers and corresponding runtimes in a file.
- Submit the job to the Teach cluster's scheduler and collect the timing output.
- Create a plot of the speedup vs number of threads. Does it follow Amdahl's law? If so, determine the value of the 'serial fraction'.
To your repo, you should also add:
- The timing results of the parallelized code as a function of the number of threads, and the corresponding speed-ups.
- Add the value of the serial fraction you determined (if applicable) at the end of the file in a line starting with '#'.
- A plot of the speed up as a function of number of threads.
As before, we expect you to use git and have several meaningful commits.
Submit your work by April 5, 23:59 PM. The usual late penalty applies.