- Ubuntu 16.04 Operating System is preferred because it contains all the required tools pre-installed.
- CMake 3.5 or above (Install with
sudo apt install cmake) - GNU gcc (5.4.0 - comes with Ubuntu. To install
sudo apt install gcc)
For both sequential vs parallel and optimized scenarios, same code is used but with different compiler parameters.
Once compiled, this code will result in an executable named multiplier.
This executable requires at least 2 arguments.
./multiplier [sample_size] [S|P|OP]
-
[sample_size]is the number of matrices that should be used for each test. -
[S|P|OP]- As the second argument, you should give at least one ofS(Sequential),P(Parallel non-optimized)andOP(Optimized Parallel)which will determine which test you want to run. -
If you want run the sequential matrix multiplication test with a sample size 10, you should run:
./multiplier 10 Sand you will see the mean execution time, standard deviation printed. -
If you want run both sequential matrix multiplication test and the non-optimized parallel matrix multiplication at the same time, each with a sample size 10, you should run:
./multiplier 10 S Pand you will see the results printed accordingly.
To run each version/scenario, please follow the following steps.
-
Open terminal and go to directory where
CMakeLists.txtfile is at. -
Create directory build inside that:
mkdir build -
Go into build directory:
cd build -
Run CMake with:
cmake ..You will see some files have been created inside build directory like Makefile, CMakeCache.txt
-
Then run
make allYou will see the executable
multiplierhas been created in that directory. -
Run the multipler with following arguments,
./multiplier [sample_size] S Pand the execution times will be printed on the terminal.
Note: If you already have created a build directory, first delete it.
-
Open terminal and go to directory where
CMakeLists.txtfile is at. -
Create directory build inside that:
mkdir build -
Go into build directory:
cd build -
Run CMake with:
cmake -DCMAKE_BUILD_TYPE=Release ..You will see some files have been created inside build directory like Makefile, CMakeCache.txt
-
Then run
make allYou will see the executable
multiplierhas been created in that directory. -
Run the multipler with following arguments,
./multiplier [sample_size] OPand the execution times will be printed on the terminal.