diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-07-12 16:53:24 +0200 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-07-12 16:53:24 +0200 |
commit | dfb236efb26bfa2643bd02317a73da3857a1ec26 (patch) | |
tree | fa35b3ff066976f91aca7920cb15f704a09ff4cc | |
parent | aadaabcdf2e5f30923fc7682f80dcc4821fd904b (diff) | |
download | fortran-assignment3-dfb236efb26bfa2643bd02317a73da3857a1ec26.tar.gz fortran-assignment3-dfb236efb26bfa2643bd02317a73da3857a1ec26.zip |
also test with -fcoarray=single
-rw-r--r-- | Makefile | 19 | ||||
-rwxr-xr-x | measure_times.sh | 15 |
2 files changed, 24 insertions, 10 deletions
@@ -27,18 +27,23 @@ FC = gfortran FFLAGS = -std=f2008 -Wall -pedantic -fbounds-check -fimplicit-none \ - -ffree-form -fcoarray=lib -O2 -c -LDFLAGS = -lcaf_mpi + -ffree-form -fcoarray=single -O2 -c -all : integrator +all : integrator integrator_single main.o main.mod : quadratures.mod functions.mod %.mod %.o : src/%.f90 - $(FC) $(FFLAGS) $< + $(FC) $(FFLAGS) -fcoarray=lib $< + +%.mod %_single.o : src/%.f90 + $(FC) $(FFLAGS) -fcoarray=single -o $*_single.o $< integrator : main.o quadratures.o functions.o - $(FC) $(LDFLAGS) $^ -o $@ + $(FC) -lcaf_mpi $^ -o $@ + +integrator_single : main_single.o quadratures_single.o functions_single.o + $(FC) $^ -o $@ res/1image_results : integrator run.sh ./run.sh 1 > $@ @@ -46,10 +51,10 @@ res/1image_results : integrator run.sh res/5images_results : integrator run.sh ./run.sh 5 > $@ -res/times : integrator measure_times.sh +res/times : integrator integrator_single measure_times.sh ./measure_times.sh > $@ clean : - -rm integrator *.{mod,o} + -rm integrator{,_single} *.{mod,o} .PHONY : all clean diff --git a/measure_times.sh b/measure_times.sh index 24f9e42..f3a028f 100755 --- a/measure_times.sh +++ b/measure_times.sh @@ -30,7 +30,7 @@ NIMAGES="1 2 3 5 8" NSUBINTERVALS="200 20000 2000000 20000000 200000000" -echo "#SUBINTERVALS IMAGES _TIME" +echo "#SUBINTERVALS IMAGES __________TIME" export TIMEFORMAT='%E' @@ -38,8 +38,17 @@ export TIMEFORMAT='%E' for NSU in $NSUBINTERVALS; do for NIM in $NIMAGES; do printf "%13s %6s " $NSU $NIM + # bash is weird... don't ask me... - bash -c "time cafrun -np $NIM ./integrator \ - gauss exp -1 1 2 $NSU" 2>&1 > /dev/null + + TIME=`bash -c "time cafrun -np $NIM ./integrator \ + gauss exp -1 1 2 $NSU" 2>&1 > /dev/null` + + if [ $NIM = 1 ]; then + TIME=$TIME\(`bash -c "time ./integrator_single \ + gauss exp -1 1 2 $NSU" 2>&1 > /dev/null`\) + fi + + printf "%14s\n" $TIME done done |