summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 11 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 999c2c5..c6044ae 100644
--- a/Makefile
+++ b/Makefile
@@ -22,16 +22,6 @@ S_STEP := 100
L_END := 12000
L_STEP := 500
-
-all:
- # This target simply compiles the binaries
- @mkdir -p bin/
- @echo "$(MAGENTA)Compiling serial and parallel binaries with $(OPTFLAGS)$(RESET)"
- $(GCC) matrixproduct.f90 -o bin/$(GCC).serial.out -$(OPTFLAGS) -fexternal-blas -lopenblas -march=native
- $(oneAPI) matrixproduct.f90 -o bin/$(oneAPI).serial.out -qmkl=sequential -$(OPTFLAGS) -heap-arrays -xHost
- $(GCC) matrixproduct.f90 -o bin/$(GCC).parallel.out -$(OPTFLAGS) -fexternal-blas -lopenblas -march=native -fopenmp
- $(oneAPI) matrixproduct.f90 -o bin/$(oneAPI).parallel.out -qmkl=parallel -$(OPTFLAGS) -heap-arrays -xHost -fopenmp
-
tests: clean
# Run the parametric tests and sweep over compiler flags
@mkdir -p results/
@@ -49,6 +39,15 @@ tests: clean
## the enivronment variables for OMP/MKL they need to be run as one "big" command
## serially. The backslash is the 'line continuation' operator that does this.
+all:
+ # This target simply compiles the binaries
+ @mkdir -p bin/
+ @echo "$(MAGENTA)Compiling serial and parallel binaries with $(OPTFLAGS)$(RESET)"
+ $(GCC) matrixproduct.f90 -o bin/$(GCC).serial.out -$(OPTFLAGS) -fexternal-blas -lopenblas -march=native
+ $(oneAPI) matrixproduct.f90 -o bin/$(oneAPI).serial.out -qmkl=sequential -$(OPTFLAGS) -heap-arrays -xHost
+ $(GCC) matrixproduct.f90 -o bin/$(GCC).parallel.out -$(OPTFLAGS) -fexternal-blas -lopenblas -march=native -fopenmp
+ $(oneAPI) matrixproduct.f90 -o bin/$(oneAPI).parallel.out -qmkl=parallel -$(OPTFLAGS) -heap-arrays -xHost -fopenmp
+
serial: ./bin/gfortran.serial.out ./bin/ifx.serial.out
# run the serial tests. ensures that only one thread is used for blas and mkl
export OMP_NUM_THREADS=1 && \
@@ -61,8 +60,8 @@ serial: ./bin/gfortran.serial.out ./bin/ifx.serial.out
parallel: ./bin/gfortran.parallel.out ./bin/ifx.parallel.out
# run the parallel tests. ensures that all threads are used for the loops, blas, and mkl
export OMP_NUM_THREADS=1 && \
- export OMP_NUM_THREADS=${NPROC} && \
- export MKL_NUM_THREADS=${NPROC} && \
+ export OMP_NUM_THREADS=$(NPROC) && \
+ export MKL_NUM_THREADS=$(NPROC) && \
./bin/$(GCC).parallel.out $(S_START) $(S_END) $(S_STEP) yes | tee results/$(GCC)_short_parallel_$(OPTFLAGS)_$(NPROC).out; \
./bin/$(oneAPI).parallel.out $(S_START) $(S_END) $(S_STEP) yes | tee results/$(oneAPI)_short_parallel_$(OPTFLAGS)_$(NPROC).out; \
./bin/$(GCC).parallel.out $(S_END) $(L_END) $(L_STEP) no | tee results/$(GCC)_long_parallel_$(OPTFLAGS)_$(NPROC).out; \