HW5: Parallelization. – 2 – Conway’s Game of Life Simple 2D universe with simple rules, complex results! 1. Any live cell with fewer than two live neighbors.

Slides:



Advertisements
Similar presentations
Simple but slow: O(n 2 ) algorithms Serial Algorithm Algorithm compares each particle with every other particle and checks for the interaction radius Most.
Advertisements

Sharks and Fishes – The problem
19 Classic Examples of Local and Global Code Optimizations Local Constant folding Constant combining Strength reduction.
Lab 8a – The Game of Life "Write a C program to display successive generations of the Game of Life using a 80 x 80 grid of square cells. Each new generation.
{ John Conway’s Game of Life.  John von Neumann  Wanted to find/create a machine that could replicate itself  Found an answer, but it was very complex.
Game of Life in 21 st Century ECE817 Presentation By Kyusik Chung
Game of Life Rules and Games Linh Tran ECE 573. What is Life? Life is just one example of a cellular automaton, which is any system in which rules are.
CITS4403 Computational Modelling Game of Life. One of the first cellular automata to be studied, and probably the most popular of all time, is a 2-D CA.
Game of Life Courtesy: Dr. David Walker, Cardiff University.
1 The Game of Life Supplement 2. 2 Background The Game of Life was devised by the British mathematician John Horton Conway in More sophisticated.
Cellular Automata (Reading: Chapter 10, Complexity: A Guided Tour)
1 Chapter 13 Artificial Life: Learning through Emergent Behavior.
CELLULAR AUTOMATON Presented by Rajini Singh.
CELLULAR AUTOMATA Derek Karssenberg, Utrecht University, the Netherlands LIFE (Conway)
CS Summer 2005 Final class - July 1st Assorted fun topics in computability and complexity.
Data Flow Analysis Compiler Design October 5, 2004 These slides live on the Web. I obtained them from Jeff Foster and he said that he obtained.
Game of Life Changhyo Yu Game of Life2 Introduction Conway’s Game of Life  Rule Dies if # of alive neighbor cells =< 2 (loneliness) Dies.
Project 1CS-4513, D-Term Programming Project #1 Concurrent Game of Life Due Friday, March 20.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Cellular Automata Orit Moskovich
A cellular automata Developed by John Conway in 1970 Its evolution is determined by its initial state.
1 GEM2505M Frederick H. Willeboordse Taming Chaos.
Cellular Automata Avi Swartz 2015 UNC Awards Ceremony.
Variations of Conway’s Game of Life Eswar Kondapavuluri.
Parallelization: Conway’s Game of Life. Cellular automata: Important for science Biology – Mapping brain tumor growth Ecology – Interactions of species.
Introduction Computational Challenges Serial Solutions Distributed Memory Solution Shared Memory Solution Parallel Analysis Conclusion Introduction: 
Chapter 12: Simulation and Modeling
Chapter 5.4 Artificial Intelligence: Pathfinding.
3.1 & 3.2: Fundamentals of Probability Objective: To understand and apply the basic probability rules and theorems CHS Statistics.
CS 484 – Artificial Intelligence1 Announcements Lab 4 due today, November 8 Homework 8 due Tuesday, November 13 ½ to 1 page description of final project.
Course material – G. Tempesti Course material will generally be available the day before the lecture Includes.
1 Chapter 13 Artificial Life: Learning through Emergent Behavior.
The Game of Life A simulation of "life". From simple rules, complex behavior arises Rules –A cell that is alive and has fewer than two live neighbors dies.
Activity 2-1: The Game of Life
Introduction to Lattice Simulations. Cellular Automata What are Cellular Automata or CA? A cellular automata is a discrete model used to study a range.
CELLULAR AUTOMATA A Presentation By CSC. OUTLINE History One Dimension CA Two Dimension CA Totalistic CA & Conway’s Game of Life Classification of CA.
Parallel Programming 0024 Spring Semester 2010 May 6, 2010.
Research Into the Time Reversal of Cellular Automata Team rm -rf / Daniel Kaplun, Dominic Labanowski, Alex Lesman.
1 Data Structures CSCI 132, Spring 2014 Lecture 4 Implementing Life.
The Game of Life Erik Amelia Amy. What is the “Game of Life?” The “Game of Life” (often referred to as Life) is not your typical game. There are no actual.
Programming Principles Chapter 1. Objectives Discuss the program design process. Introduce the Game of Life. Discuss object oriented design. – Information.
עקרונות תכנות מונחה עצמים תרגול 6 - GUI. סיכום ביניים GUI:  Swing  Basic components  Event handling  Containers  Layouts.
Model Iteration Iteration means to repeat a process and is sometimes referred to as looping. In ModelBuilder, you can use iteration to cause the entire.
Review Recursion Call Stack. Two-dimensional Arrays Visualized as a grid int[][] grays = {{0, 20, 40}, {60, 80, 100}, {120, 140, 160}, {180, 200, 220}};
Scratch Flappy Bird Coding By Aaisha Ahmed. This is called the velocity it keeps the bird moving through out the whole game. (moving up & down) When you.
A Variation on Conway’s Game of Life Winston Lee EPS 109.
Clicker questions 11/14/13 CSE 1102 Fall A. Composite B. Holder C. Proxy D. Factory E. Impossible to tell from diagram In this example, we want.
The Northern Lights: Demonstrations. Programmability Overview A major aspect of our project is programmability- it is an interactive display medium, the.
Robot Intelligence Technology Lab. Generalized game of life YongDuk Kim.
Week 9 - Monday.  What did we talk about last time?  Method practice  Lab 8.
Conway’s Game of Life Jess Barak Game Theory. History Invented by John Conway in 1970 Wanted to simplify problem from 1940s presented by John von Neumann.
CMSC 202 Lesson 15 Debugging. Warmup  What is the bug in the following code? int* foo(int a) { return &a; }
2.2 Threads  Process: address space + code execution  There is no law that states that a process cannot have more than one “line” of execution.  Threads:
Practical Session 9 Computer Architecture and Assembly Language.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Chapter 5.4 Artificial Intelligence: Pathfinding
Cellular automata.
Introduction Abstract
Two-Dimensional Arrays
Illustrations of Simple Cellular Automata
Week 9 - Monday CS 121.
Cellular Automata.
Two-Dimensional Arrays
Data Flow Analysis Compiler Design
Computer Architecture and Assembly Language
Function Overloading.
AP Java Learning Objectives
Activity 2-1: The Game of Life
Atlantis Game.
Variables and Constants
Presentation transcript:

HW5: Parallelization

– 2 – Conway’s Game of Life Simple 2D universe with simple rules, complex results! 1. Any live cell with fewer than two live neighbors dies 2. Any live cell with more than three live neighbors dies 3. Any live cell with two or three live neighbors lives on 4. Any dead cell with three live neighbors becomes alive

– 3 – Interesting Stable Patterns GliderLightWeight Space Ship Pulsar

– 4 – “Gosper’s glider gun”

– 5 – Typical Random Initial Universe NOTE: board wraps around (top/bottom, L/R) DEMO

– 6 – Key Part of the Code: for (curgen = 0; curgen < gens_max; curgen++) for (i = 0; i < nrows; i++){ for (j = 0; j < ncols; j++){ int inorth = mod (i-1, nrows); int isouth = mod (i+1, nrows); int jwest = mod (j-1, ncols); int jeast = mod (j+1, ncols); const char neighbor_count = BOARD (inboard, inorth, jwest) + BOARD (inboard, inorth, j) + BOARD (inboard, inorth, jeast) + BOARD (inboard, i, jwest) + BOARD (inboard, i, jeast) + BOARD (inboard, isouth, jwest) + BOARD (inboard, isouth, j) + BOARD (inboard, isouth, jeast); BOARD(outboard, i, j) = alivep (neighbor_count, BOARD (inboard, i, j)); } SWAP_BOARDS( outboard, inboard ); }

– 7 – HW5: Your Goal Improve performance via parallelization use pthreads use at least 2 threads (probably 4 since 4 CPUs on UG*) Further improve performance via other optimizations by putting what we learnt all together hand code optimizations cache optimizations locks/synchronization better cell representation eliminating redundancy and/or unnecessary work compiler flags