This is the MPI and OpenMp implementation of the sequential game of life program in extra_seq.c
file.
To compile the program just run
make
The program needs to run in bash terminal. To run the program run:
mpirun -np <number_of_processes> ./main <width> <height>
This will run the program with set number of processes and simulate the game of life. At the end it will output something like this:
....
iter = 198, Global population count = 368
iter = 199, Global population count = 370
MPI Time taken: 0.047932 seconds
To compile the OpenMP version do the following:
make open
Then to run do the following:
./open <width> <height>
The output will be something like this:
...
iter = 197, Global population count = 368
iter = 198, Global population count = 370
OpenMP Time taken: 0.024197 seconds
export PATH=/usr/lib64/openmpi/bin:$PATH