From da363779bf41fe3e3fcc2a69e283cbf0f536e6e5 Mon Sep 17 00:00:00 2001 From: David Minton Date: Fri, 2 Apr 2021 18:02:35 -0400 Subject: [PATCH] Updated with profiling tool --- .gitignore | 1 + Makefile.Defines | 36 +++++++++++-------- descriptionator.sh | 7 ++++ .../mars_ejecta/profmaker.sh | 2 ++ 4 files changed, 31 insertions(+), 15 deletions(-) create mode 100755 descriptionator.sh create mode 100755 examples/rmvs_swifter_comparison/mars_ejecta/profmaker.sh diff --git a/.gitignore b/.gitignore index f1630b4a5..99c34ac64 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ !*/python # whitelist only the files that ever need to be tracked !*.f90 +!*.sh !CHANGELOG !README.md !README.swifter diff --git a/Makefile.Defines b/Makefile.Defines index 81b0f1b44..cc15ec89a 100644 --- a/Makefile.Defines +++ b/Makefile.Defines @@ -46,30 +46,36 @@ COLLRESOLVE_HOME = $(ROOT_DIR)/collresolve/ # DO NOT include in FFLAGS the "-c" option to compile object only # this is done explicitly as needed in the Makefile ADVIXE_DIR = /apps/cent7/intel/advisor_2019 -ADVIXE_FLAGS = -g -O2 -ipo -qopt-report=5 -vec -vecabi=cmdtarget -simd -parallel -parallel-source-info=2 -qopenmp -shared-intel -debug inline-debug-info -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -fp-model no-except -mp1 -xhost -traceback +ADVIXE_FLAGS = -g -O2 -qopt-report=5 -vec -vecabi=cmdtarget -simd -shared-intel -debug inline-debug-info -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -fp-model no-except -mp1 -xhost -traceback VTUNE_FLAGS = -g -O2 -vec -simd -shared-intel -qopenmp -debug inline-debug-info -parallel-source-info=2 -parallel -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -qopenmp -fp-model no-except -mp1 -xhost -traceback -IDEBUG = -O0 -g -traceback -mp1 -fp-model strict -debug all -align all -pad -ip -prec-div -prec-sqrt -ftz -assume protect-parens +#Be sure to set the environment variable KMP_FORKJOIN_FRAMES=1 for OpenMP debuging in vtune -#FORTRAN = ifort -#FFLAGS = $(ADVIXE_FLAGS) -#FFLAGS = $(IDEBUG) +IDEBUG = -O0 -warn all -nogen-interfaces -no-pie -no-ftz -fpe-all=0 -g -traceback -mp1 -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin -#debug flags +STRICTREAL = -mp1 -fp-model strict -prec-div -prec-sqrt -ftz -assume protect-parens +SIMDVEC = -vec -simd -xhost -align all -assume contiguous_assumed_shape -vecabi=cmdtarget +PAR = -parallel -qopenmp +HEAPARR = -heap-arrays 1048576 +OPTIMIZE = -qopt-report=5 -GDBFLAGS = -ggdb -g3 -O0 -fbacktrace -fbounds-check -fcheck=all -ffpe-trap=invalid,zero +#FFLAGS = -init=snan,arrays -traceback -no-wrap-margin -O3 -g -CB -nogen-interfaces -no-pie -fp-speculation=safe $(SIMDVEC) $(PAR) #$(HEAPARR) +FORTRAN = ifort +#FFLAGS = $(IDEBUG) +FFLAGS = -init=snan,arrays -traceback -no-wrap-margin -O3 -g $(SIMDVEC) $(STRICTREAL) -FORTRAN = gfortran -FFLAGS = -O3 -FFLAGS = $(GDBFLAGS) -#FFLAGS = -Og -ggdb -g3 -fopenmp -ftree-parallelize-loops=4 -fbacktrace -fbounds-check -fcheck=all -fsanitize=undefined -fsanitize=address -fsanitize=leak -##debug flags -#FFLAGS = -O3 -ggdb -g3 -ftree-parallelize-loops=4 -fbacktrace -ffpe-trap=zero,invalid,overflow,underflow,denormal -fcheck=all -fbounds-check -fbacktrace -fsanitize=undefined -fsanitize=address -fsanitize=leak -#-Wall -Warray-bounds -Wimplicit-interface -Wextra -#-Warray-temporaries +GDEBUG = -ggdb -g3 -Og -fbacktrace -fbounds-check -fcheck=all -ffpe-trap=zero,invalid,overflow,underflow,denormal +GPRODUCTION = -O3 +GPAR = -fopenmp -ftree-parallelize-loops=4 +GMEM = -fsanitize=undefined -fsanitize=address -fsanitize=leak +GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries +#FORTRAN = gfortran +#FFLAGS = -ffree-line-length-none $(GDEBUG) +AR = ar + # DO NOT include in CFLAGS the "-c" option to compile object only # this is done explicitly as needed in the Makefile diff --git a/descriptionator.sh b/descriptionator.sh new file mode 100755 index 000000000..3d86c8f14 --- /dev/null +++ b/descriptionator.sh @@ -0,0 +1,7 @@ +#!/bin/bash +for file_out in */*.f90; do + file_in="../../swifter-omp/$file_out"; + desc=$(grep "Description" $file_in | sed "s/! Description : //") + sed -i "" "s/Compute Hill sphere radii of massive bodie/$desc/" $file_out +done + diff --git a/examples/rmvs_swifter_comparison/mars_ejecta/profmaker.sh b/examples/rmvs_swifter_comparison/mars_ejecta/profmaker.sh new file mode 100755 index 000000000..cb31cb5b4 --- /dev/null +++ b/examples/rmvs_swifter_comparison/mars_ejecta/profmaker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +gprof ./swifter_symba_ringmoons | /home/daminton/git/gprof2dot/gprof2dot.py | dot -Tpng -o output.png