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. How to Program, Part VI
  7. exercises
  8. pyMPI tutorial
  9. Calculating PI, Part I
  10. Calculating PI, Part II
  11. Calculating PI, Part III
  12. Dividing Work
  13. More MPI
  14. Poogle - Web Search
  15. Mandelbrot Sets
  16. Mandelbrot, The Code
  17. Mandelbrot, The Images
  18. Mandelbrot In CUDA
  19. Conway's Life, Part I
  20. Life Code Listing
  21. Conway's Life, Part II
  22. 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.