This assignment is broken into two separate programs:
- data: data.c, dataFunc.c, dataFunc.h
- task: task.c, taskFunc.c, taskFunc.h, queue.c, queue.h
Use data parallelism to split the work of running game of life. All pthreads perform the same operation but divides the work.
Uses task parallism to run the game of life using threads. All pthreads perform different operations, dividing the work between them.
- OS: Unix (Ubuntu prefered)
- c compiler (gcc preferred)
- pthread library
Note: pthread library is already installed on Ubuntu 15.10 or newer. For older version use the following commands:
sudo apt-get install libpthread-stubs0-dev
To compile both program, move into the main directory where the source code is located and type make. The makefile should compile both programs with no warnings.
To run the data parallel program, type in: ./data Numthreads(int) SizeGrid(int) NumbIterate(int)
where:
- Numthreads is the number of threads the program will generate. Must be greater than 0.
- SizeGrid is the size of the grid. Must be greater than 0.
- NumIteration is the number of steps the game of life goes through. Must be greater than 0.
To run the task parallel program, type in: ./task SizeGrid(int) NumbIterate(int)
where:
- SizeGrid is the size of the grid. Must be greater than 0.
- NumIteration is the number of steps the game of life goes through. Must be greater than 0.
To run either programs with preset command line arguments type in
make test
to run the data parallel programmake test3
to run the task parallel program
To clean up the project, move into the main directory and type make clean to clean up the entire project.