summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorConnor Moore <connor@hhmoore.ca>2026-01-30 23:13:40 -0500
committerConnor Moore <connor@hhmoore.ca>2026-01-30 23:13:40 -0500
commite1babc4f71ba2e3fa3139dddb6d77f1c7b5a9683 (patch)
tree463089ac45f16f5650e9ae8c1b69c0853b2e493f /Makefile
parentd81191c40989de0c3809c4eade2c58ab1c44146d (diff)
Added support for OpenMP. Cleaned up makefile. Added gnuplot file for `make plots`.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 25 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 39b5bdf..32449de 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,31 @@
-gnu:
- gfortran matrixproduct.f90 -o bin/gcc.out -lblas -O3 -fopenmp
-intel:
- ifx matrixproduct.f90 -o bin/intel.out -lblas -O3 -fopenmp -heap-arrays
+GCC=gfortran
+oneAPI=ifx
-dir:
- mkdir results bin
+all:
+ mkdir -p bin/
+ $(GCC) matrixproduct.f90 -o bin/$(GCC).serial.out -O3 -fexternal-blas -lopenblas -march=native
+ $(oneAPI) matrixproduct.f90 -o bin/$(oneAPI).serial.out -qmkl=sequential -O3 -heap-arrays -xHost
+ $(GCC) matrixproduct.f90 -o bin/$(GCC).parallel.out -O3 -fexternal-blas -lopenblas -march=native -fopenmp
+ $(oneAPI) matrixproduct.f90 -o bin/$(oneAPI).parallel.out -qmkl=parallel -O3 -heap-arrays -xHost -fopenmp
-tests: clean dir gnu intel
- ./bin/gcc.out 100 100 3500 yes > results/gcc_short
- ./bin/intel.out 100 100 3500 yes > results/intel_short
+tests: clean all
+ mkdir -p results/
- ./bin/gcc.out 3500 1000 10500 no > results/gcc_long
- ./bin/intel.out 3500 1000 10500 no > results/gcc_long
+ # Serial runs
+ export OMP_NUM_THREADS=1
+ ./bin/$(GCC).serial.out 100 3500 100 yes > results/$(GCC)_short_serial
+ ./bin/$(oneAPI).serial.out 100 3500 100 yes > results/$(oneAPI)_short_serial
+
+ ./bin/$(GCC).serial.out 3500 20000 500 no > results/$(GCC)_long_serial
+ ./bin/$(oneAPI).serial.out 3500 20000 500 no > results/$(oneAPI)_long_serial
+
+ # Parallel runs
+ export OMP_NUM_THREADS=8
+ ./bin/$(GCC).parallel.out 100 3500 100 yes > results/$(GCC)_short_parallel
+ ./bin/$(oneAPI).parallel.out 100 3500 100 yes > results/$(oneAPI)_short_parallel
+
+ ./bin/$(GCC).parallel.out 3500 20000 500 no > results/$(GCC)_long_parallel
+ ./bin/$(oneAPI).parallel.out 3500 20000 500 no > results/$(oneAPI)_long_parallel
plots:
gnuplot -p plots.gnu