Game Of Life – C Parallel Implementation (PThreads, OpenMP)

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:

 

Download Project Source Code

 

 

A. Bechtsoudis