1. How to Program, Part I
  2. How to Program, Part II
  3. How to Program, Part III
  4. How to Program, Part IV
  5. How to Program, Part V
  6. exercises
  7. pyMPI tutorial
  8. Calculating PI, Part I
  9. Calculating PI, Part II
  10. Calculating PI, Part III
  11. Poogle - Web Search
  12. Mandelbrot Sets
  13. Mandelbrot, The Code
  14. Mandelbrot, The Images
  15. Conway's Life, Part I
  16. Life Code Listing
  17. Conway's Life, Part II
  18. MPI Life Code Listing

Conway's Life, Part II

We use something called "ghost zones" to help us split up the calculation of the game of life across several processors.

In the image, the gold color cells belong to and are updated by proc 0. The beige cells are owned and updated by proc 1.

Since the calculation at each cell in the game of life depends on the contents of neighboring cells, proc0 keeps a copy of the beige cells from proc 1. It uses those values to update the gold cells. These copied cells are the "ghost zones."

After each update, proc 0 and proc 1 exchange data -- proc 0 sends the values it has for the gold cells to proc 1, and proc 1 sends the values it has for the beige cells to proc 0.

In this way, all the cells of the board can get updated and the work of updating is distributed. This basic technique is employed in many different scientific applications.