Download presentation
Presentation is loading. Please wait.
Published byCuthbert Jones Modified over 9 years ago
1
Parallelization: Conway’s Game of Life
2
Cellular automata: Important for science Biology – Mapping brain tumor growth Ecology – Interactions of species competing for resources Cognitive science, hydrodynamics, dermatology, chemistry, environmental science, agriculture, operational research, and many others
3
Cellular automaton Has a grid of cells Performs functions automatically Exhibits chaotic behavior – initial set of conditions produces random result after certain number of time steps
4
Neighborhoods Von Neumann Moore
5
Toroidal grid
6
Conway’s Game of Life 2 cell states: ALIVE and DEAD 4 rules: – If a cell has fewer than 2 ALIVE neighbors, it will be DEAD in the next time step – If an ALIVE cell has 2 or 3 ALIVE neighbors, it will be ALIVE in the next time step – If a cell has more than 3 ALIVE neighbors, it will be DEAD in the next time step – If a DEAD cell has 3 ALIVE neighbors, it will be ALIVE in the next time step
7
How do we simulate? Small board: with pencil and paper Beyond a small board: single computer Even bigger: parallel processing Bigger and bigger: cluster computer
8
Parallelism Concurrency (doing things at the same time) Multiple flows of execution (virtual entities that perform computations) working on the same problem Distributed Memory Shared Memory Hybrid
9
Flows of execution Processes – Distributed memory – Must communicate (message passing) Threads – Shared memory Processes with threads – Hybrid
10
Parallel hardware Multiple cores on a single compute node – Shared memory Multiple compute nodes sharing a network – Distributed memory Multiple compute nodes with multiple cores sharing a network – Hybrid
11
What are some standards? Message Passing Interface (MPI) – distributed memory/message passing OpenMP – shared memory MPI/OpenMP - hybrid
12
How to approach the parallel algorithm State clearly the goal of the algorithm Use the goal to determine the algorithm’s data structures Identify the data that will be contained within the data structures and parallelized Determine load balancing Determine the parallel tasks that are performed on the data – draw pictures and write descriptions Determine message passing Create a written representation of values needed for the parallel tasks Develop pseudo-code for the algorithm
13
Considerations Assume hybrid parallelism – Distributed memory, shared memory, or serial can be refined from hybrid Hybrid on 1 thread per process is just distributed memory Hybrid on 1 process is just shared memory Hybrid on 1 thread and 1 process is just serial The entire code is executed by each process Threads only execute code for which they are spawned
14
What is the goal of the algorithm? A grid of cells is updated at each time step for some number of time steps based on the rules of Conway’s Game of Life.
15
What are the algorithm’s data structures? A grid of cells is updated at each time step for some number of time steps based on the rules of Conway’s Game of Life.
16
What are the algorithm’s data structures?
17
What data is parallelized? Each process receives a certain number of rows Each thread receives a certain number of columns
18
How is the load balanced?
19
What are the parallel tasks?
20
What message passing occurs?
21
What values are needed for the parallel tasks?
22
MPI functions
23
OpenMP construct
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.