1 / 15

The Game Of Life

The Game Of Life. Ohad Shitrit Alon Gavra Group - 1. BGU Parallel Programming 2014. Conclusion. Parallel Analysis. Introduction:. Game of Life is a cellular automata exercise created by mathematician John H. Conway in 1970.

cianna
Download Presentation

The Game Of Life

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Game Of Life Ohad Shitrit AlonGavra Group - 1 BGU Parallel Programming 2014

  2. Conclusion • Parallel Analysis Introduction: • Game of Life is a cellular automata exercise created by mathematician John H. Conway in 1970. • It's not really a game in the traditional sense since the outcome is decided solely by the initial set up and there aren't any players. • The game made Conway instantly famous, but it also opened up a whole new field of mathematical research, the field of cellular automata • Lets play…

  3. Conclusion • Parallel Analysis The game rules: • Any live cell with fewer than two live neighbours dies, as if caused by under-population. • Any live cell with two or three live neighbours lives on to the next generation. • Any live cell with more than three live neighbours dies, as if by overcrowding. • Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

  4. Conclusion • Parallel Analysis Computational Challenges: • The game board size is NxM=L • Each cell has to be evaluated according to the set of rules • A round or “generation” takes O(L) just to evaluate. • This is an embarrassingly parallel problem • Pseudo Code for Game of Life: Bottleneck!

  5. Conclusion • Parallel Analysis Serial Solutions: • The serial solution is straight forward. • Unfortunately, when we simulate multiple generations with large boards this become a time consuming problem. • Each cell has to be individually evaluated by it’s nearby neighbours • So it becomes clear why we should turn to parallel solutions.

  6. Conclusion • Parallel Analysis Distributed Memory: • Game of life takes place on a N x M grid • Distribute the grid on z processors (domain decomposition) • Simplest way: row wise or column wise • More general approach: rectangular areas (checkerboard partitioning)

  7. Conclusion • Parallel Analysis Distributed Memory: • Initial (master) grid is in process 0 • Parts must get distributed to the other processes

  8. Conclusion • Parallel Analysis Distributed Memory: • Ghost cell: • For updating the cells, we need all the neighbours of all the • Cells • “ghost cells” around each block are necessary • This mean that cells are not continuous in memory, neither in the master nor in the worker grid

  9. Conclusion • Parallel Analysis Shared Memory Solutions: • For shared memory threads, this is almost a trivial exercise • Using a domain decomposition, put an OpenMP for pragma around one of the inner loops Here!

  10. Conclusion • ParallelAnalysis Parallel Analysis: • Amdahl’s law – strong scaling * Parallelization: Conway’s Game of Life By Aaron Weeden , Shodor Education Foundation, Inc.

  11. Conclusion • Conclusion • ParallelAnalysis • ParallelAnalysis Parallel Analysis: Parallel Analysis: • Gustafson’s Law– weak scaling * Parallelization: Conway’s Game of Life By Aaron Weeden , Shodor Education Foundation, Inc.

  12. Conclusion • Conclusion • Conclusion • Conclusion • ParallelAnalysis • ParallelAnalysis • ParallelAnalysis • ParallelAnalysis Parallel Analysis: Parallel Analysis: Parallel Analysis: Parallel Analysis: • Speed Up: • In an article we came across, the author examined 5 different programs, from the simplest serial to the sophisticated parallel program. • Using the Shared memory approach he managed to achieve a speedup of 127 times the serial program. • Speed Up: • In an article we came across, the author examined 5 different programs, from the simplest serial to the sophisticated parallel program. • Using the Shared memory approach he managed to achieve a speedup of 127 times the serial program. Based on an article by Jon Skeet: https://msmvps.com/blogs/jon_skeet/archive/2008/06/01/more-parallelisation-fun-conway-s-game-of-life.aspx Based on an article by Jon Skeet: https://msmvps.com/blogs/jon_skeet/archive/2008/06/01/more-parallelisation-fun-conway-s-game-of-life.aspx

  13. Conclusion • Conclusion • ParallelAnalysis • Parallel Analysis Conclusion: • Game of Life is the basis of much research in the field of cellular automata. As a result learning how to use parallel programming to solve the is problem has great potential in related fields of interest. • As we’ve seen the parallel solutions are easy to implement and provide improved performance. • So why not?

  14. Questions?

  15. Conclusion • Conclusion • ParallelAnalysis • Parallel Analysis References: • Jon Skeet • https://msmvps.com/blogs/jon_skeet/archive/2008/06/01/more-parallelisation-fun-conway-s-game-of-life.aspx • Dr. Dobbs • http://www.drdobbs.com/parallel/conways-game-of-life-in-parallel/240143844 • http://www.drdobbs.com/parallel/game-of-life-with-mpi/240159390 • Parallelization: Conway’s Game of Life By Aaron Weeden, Shodor Education Foundation,Inc. • Introduction to Parallel Programming with MPI, Hans Joachim Pflug, AACHEN UNIV.

More Related