Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Parallel Processing Final Project SHARKS & FISH Presented by: Idan Hammer Elad Wallach Elad Wallach.

Similar presentations


Presentation on theme: "Introduction to Parallel Processing Final Project SHARKS & FISH Presented by: Idan Hammer Elad Wallach Elad Wallach."— Presentation transcript:

1 Introduction to Parallel Processing Final Project SHARKS & FISH Presented by: Idan Hammer Elad Wallach Elad Wallach

2 Definitions A version of the “ Game of life ”. A version of the “ Game of life ”. The ocean should be modeled as two dimensional array of cells, each one can populate a fish or a shark. The ocean should be modeled as two dimensional array of cells, each one can populate a fish or a shark. Fish and the sharks are governed by rules. Fish and the sharks are governed by rules.

3 Fish Rules 1. If there is one empty adjacent cell, the fish moves to this cell. 2. If there is more than one empty adjacent cell, the fish moves to one cell chosen at random. 3. If there are no empty adjacent cells, the fish stays where it is. 4. If the fish moves and has reached its breeding age, it gives birth to a baby fish, which is left in the vacating cell. 5. Fish die after x generations.

4 Sharks Rules 1. If one adjacent cell is occupied by a fish, the shark moves to this cell and eats the fish. 2. If more than one adjacent cell is occupied by a fish, the shark chooses one fish at random, moves to the cell occupied by the fish, and eats the fish. 3. If no fish in adjacent cells, the shark chooses an unoccupied adjacent cell to move to in a similar manner as fish move. 4. If the shark moves and has reached its breeding age, it gives birth to a baby shark, which is left in the vacating cell. 5. If a shark has not eaten for y generations, it dies.

5 The Implementation Dividing the 2D array into blocks/strips. Dividing the 2D array into blocks/strips. Each processor should be govern a certain block/strip. Each processor should be govern a certain block/strip. The moving from one block to another will be performed by MPI routines. The moving from one block to another will be performed by MPI routines. Graphics output by using MPE library. Graphics output by using MPE library.

6 Using strip division

7 One processor block

8 2D array using Blocks division

9 Data Dependencies Fish and sharks lying along the boundary of a processor, need to know about the grid cells lying along the boundary of other processors.

10 Output Generating the program ’ s output using MPE will produce a result like the one shown.


Download ppt "Introduction to Parallel Processing Final Project SHARKS & FISH Presented by: Idan Hammer Elad Wallach Elad Wallach."

Similar presentations


Ads by Google