Simple C++ implementation of John Conway's Game of Life, including a parallelised OpenMP branch.
Dependencies: Boost, STL, C++11, OpenMP (for OpenMP branch).
On some platforms, it is necessary to set CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to include the correct version of Boost. This might happen when Boost is in a non-standard location (FindBoost.cmake cannot find it) or when compiling with gcc on OSX (needs gcc-compiled Boost, not clang-compiled).
In-source or out-of-source:
mkdir build
cd build
cmake path/to/source
make
Implemented using Catch. Tests are fairly self-explanatory.
cd /path/to/build/test
./test
cd /path/to/build/bin
./game_of_life --frames [number of iterations to simulate] --out [output path and prefix, e.g. preexisting_output_dir/outprefix-] --init [initialisation data]
For example:
./game_of_life --frames 2 --out output/big_output_ --init ../test/test_grid_1024.txt
Remote deployment/execution is done using ssh, for systems set up with the Sun Grid Engine (qsub job submission). First, edit /path/to/build/bin/connect_ssh.sh to be have the form:
ssh username@server
deploy.sh
deploys to that server and builds the project. Note that it may be necessary to change the git remote URI used in deploy.sh
-- this project is not currently public.
run_remote.sh
submits an example job using the deployed version of submit_qsub.sh
.
Once the cluster job has finished, call fetch_results.sh
to retrieve the output data.
Call the MATLAB script 'visualise_from_data.m' within the directory containing the results. This generates an output video.