Panagiota Gyftou - cs22400025
gyftoupan@di.uoa.gr
📦exercise_1/
├── 📂include/
│ └── *.h # Header files
├── 📂modules/
│ └── *.c # Source code files
├── 📂src/
│ ├── main.c
│ └── 📄Makefile
├── 📄Makefile
📦exercise_2/
📦exercise_3/
📦exercise_4/
📦exercise_5/
📦exercise_6/
📦exercise_7/
📦exercise_8/
📦exercise_9/
📄README.md
📄Report_7115112400025.pdf This helper script automates building and running every exercise in the Parallel Computing Systems handout. It will compile the serial, Pthreads and OpenMP versions, execute each benchmark with your chosen parameters, and collect timing and output data.
Run the following script to execute all the exercises!
Also check for individual program runs and memory leaks
To compile the program, use the following command:
# Compile the main program
make If you compiled the files from the previous section you can run:
$ ./my_program *ARGS
*ARGS
You can also compile and run through the Makefile:
runto compile and run the main program and testsrunto compile and run only the main programrun-teststo compile and run only the tests
Here is the command to compile & run:
# Compile and run the main program and tests
make run ARGS="*ARGS"*ARGS
Don't forget to give the arguments through the ARGS variable!
Visit the Makefile files to get more info about the commands available (valgrind, run etc)
# exercise 1
make run ARGS="-d 100000000 -t 4" # -d(darts) -t(threads)
# exercise 2
make run ARGS="-i 100000000 -t 4" # -i(iterations) -t(threads)
# exercise 3
make run ARGS="-i 100000000 -t 4" # -i(iterations) -t(threads)
# exercise 4
make run ARGS="-i 1000000 -t 4" # -i(iterations) -t(threads)
# exercise 5
make run ARGS="4 10000 10000" # Default execution (threads) (m) (n)
make run ARGS="4 10000 10000 full" # (threads) (m) (n) full
make run ARGS="4 10000 10000 upper" # (threads) (m) (n) upper
### Notes on Exercise 5
- If a **fifth argument** is provided:
- `"full"` disables the upper-triangular optimization and performs full matrix multiplication.
- `"upper"` enables optimization by multiplying only the upper triangular part of the matrix.
# exercise 6
## -- serial --
make run ARGS="-g 1000 -gs 64 -impl 0 -t 1" # -g(generations) -gs(grid size) -impl(serial/parallel) -t(threads)
## -- parallel --
make run ARGS="-g 1000 -gs 64 -impl 1 -t 3"
# exercise 7
## -- serial - row_wise --
make run ARGS="-d 10000 -sp 0 -rc 0 -t 1" #-d(dimension) -sp(serial/parallel) -rc(row/column wise) -t(threads)
## -- serial - column_wise --
make run ARGS="-d 10000 -sp 0 -rc 1 -t 1" #-d(dimension) -sp(serial/parallel) -rc(row/column wise) -t(threads)
## -- parallel - column_wise --
make run ARGS="-d 10000 -sp 1 -rc 1 -t 2" #-d(dimension) -sp(serial/parallel) -rc(row/column wise) -t(threads)
# exercise 8
## -- serial --
make run ARGS="-s 1000 -sp 64 -impl 0 -t 1" # -s(size) -sp(serial/parallel) -t(threads)
## -- parallel --
make run ARGS="-s 1000 -sp 64 -impl 1 -t 4"
# exercise 9
## -- serial --
make run ARGS="-g 1000 -gs 64 -impl 0 -t 1" # -g(generations) -gs(grid size) -impl(serial/parallel) -t(threads)
## -- parallel --
make run ARGS="-g 1000 -gs 64 -impl 1 -t 3"