Anestis Bechtsoudis » openmp http://bechtsoudis.com Driven by Passion for Challenges Tue, 01 Jul 2014 12:30:55 +0000 en-US hourly 1 http://wordpress.org/?v=3.9.2 Game Of Life – C Parallel Implementation (PThreads, OpenMP) http://bechtsoudis.com/2011/03/26/game-of-life-c-parallel-implementation-pthreads-openmp/#utm_source=rss&utm_medium=rss&utm_campaign=game-of-life-c-parallel-implementation-pthreads-openmp http://bechtsoudis.com/2011/03/26/game-of-life-c-parallel-implementation-pthreads-openmp/#comments Sat, 26 Mar 2011 12:27:08 +0000 http://bechtsoudis.com/?p=50 In this project i have developed a parallel version of the John Conway’s Game Of Life Cellular Automaton. The source code has been written in Ansi-C and is based on the shared memory model. For the parallelization i have used the Posix Threads and OpenMP APIs. In order evaluate the performance of the code, measurements in two different architecture machines have been made (specs are included in report). The project was running on the 1st semester of 2010, on behalf of the “Parallel Processing” undergraduate course, below the teaching of K. Karantasis.

The basic thought in order to parallelize the algorithm execution, was to divide the matrix into smaller equal pieces. The cellular automaton is represented with a MxN matrix, where each cell indicates the living status (dead or alive). In order to store the calculated next round state i used a second matrix with the same dimensions. By the end of each round a swap takes place between the two pointers of the matrixes, in order to have the next round current state.

 

Note: More information can be found in the full report (written in Greek).

 

Here is a short demo of the console execution:

//www.youtube.com/watch?v=ug7L7AlUkng

 

Download Project Source Code

 

 

A. Bechtsoudis

 

]]>
http://bechtsoudis.com/2011/03/26/game-of-life-c-parallel-implementation-pthreads-openmp/feed/ 0