diff --git a/Solver/Makefile.in b/Solver/Makefile.in index 03b41b930..efdb31cbf 100755 --- a/Solver/Makefile.in +++ b/Solver/Makefile.in @@ -34,12 +34,15 @@ EXTLIB_INC = ######################################## # 3.- User defined compilation flags ######################################## +GNU_HPC_FLAGS= -cpp -fallow-argument-mismatch -std=legacy -ffree-line-length-0 -O3 -ftree-vectorize \ + -ftree-vectorizer-verbose=0 -fbackslash -D_has_Quad -march=znver3 -funroll-loops GNU_RELEASE_FLAGS= -cpp -ffree-line-length-0 -O3 -ftree-vectorize -ftree-vectorizer-verbose=0 \ -fbackslash -D_has_Quad GNU_DEBUG_FLAGS= -ffree-line-length-0 -cpp -O0 -g -fcheck=all -Wno-unused-variable \ -fbacktrace -fbounds-check -finit-real=snan -Wall \ -ffpe-trap=invalid,zero,overflow -fcheck-array-temporaries \ -fbackslash -fcheck=pointer -D_has_Quad +INTEL_HPC_FLAGS= -cpp -Ofast -msse4.2 -axAVX,CORE-AVX2 -assume bscc -D_has_Quad -fp-model=fast=2 -ipo INTEL_RELEASE_FLAGS= -cpp -O3 -assume bscc -D_has_Quad -fp-model precise INTEL_DEBUG_FLAGS= -cpp -O0 -g -warn all -fpscomp logicals -traceback \ -check bounds -check uninit -ftrapuv -debug all \ @@ -99,6 +102,13 @@ ifeq ($(MODE),RELEASE) else ifeq ($(FC),ifort) FFLAGS=$(INTEL_RELEASE_FLAGS) endif +else ifeq ($(MODE),HPC) + MACROS+= -D_HPC_MODE + ifeq ($(FC),gfortran) + FFLAGS=$(GNU_HPC_FLAGS) + else ifeq ($(FC),ifort) + FFLAGS=$(INTEL_HPC_FLAGS) + endif else ifeq ($(MODE),DEBUG) ifeq ($(FC),gfortran) FFLAGS=$(GNU_DEBUG_FLAGS) diff --git a/Solver/src/libs/monitors/ResidualsMonitor.f90 b/Solver/src/libs/monitors/ResidualsMonitor.f90 index c2850f920..2f4e02035 100644 --- a/Solver/src/libs/monitors/ResidualsMonitor.f90 +++ b/Solver/src/libs/monitors/ResidualsMonitor.f90 @@ -194,6 +194,9 @@ subroutine Residuals_WriteToFile ( self , iter , t, TotalSimuTime, SolverSimuTim integer :: i integer :: fID +#ifdef _HPC_MODE + return +#endif if ( MPI_Process % isRoot ) then ! ! Open file diff --git a/doc/UserManual.pdf b/doc/UserManual.pdf index 66996e355..e3084c2ac 100644 Binary files a/doc/UserManual.pdf and b/doc/UserManual.pdf differ diff --git a/doc/UserManual.tex b/doc/UserManual.tex index cbdd35eb8..202bc2527 100644 --- a/doc/UserManual.tex +++ b/doc/UserManual.tex @@ -68,7 +68,7 @@ \chapter{Compiling the code} \label{sect:compiling} with the desired options (bold are default): \begin{itemize} -\item MODE=DEBUG/\textbf{RELEASE} +\item MODE=DEBUG/HPC/\textbf{RELEASE} \item COMPILER=ifort/\textbf{gfortran} \item COMM=PARALLEL/\textbf{SEQUENTIAL} \item ENABLE\_THREADS=NO/\textbf{YES} @@ -80,6 +80,8 @@ \chapter{Compiling the code} \label{sect:compiling} $ make all COMPILER=ifort COMM=PARALLEL \end{lstlisting} +\item MODE=DEBUG/HPC/\textbf{RELEASE} flag enables various compiler flags for different levels of code optimization. Furthermore, MODE=HPC disables residual file writing to improve performance. + \item The ENABLE\_THREADS=YES flag enables shared memory simulations using OpenMP. \item The COM=PARALLEL flag enables distributed memory simulations using MPI. @@ -1670,7 +1672,7 @@ \section{Compiling the Problem File} \end{lstlisting} where again the options are (bold are default): \begin{itemize} -\item MODE=DEBUG/\textbf{RELEASE} +\item MODE=DEBUG/HPC/\textbf{RELEASE} \item COMPILER=ifort/\textbf{gfortran} \item COMM=PARALLEL/\textbf{SEQUENTIAL} \item ENABLE\_THREADS=NO/\textbf{YES} diff --git a/utils/ProblemFile/Makefile b/utils/ProblemFile/Makefile index c8f03bd5e..ef7d4a5ad 100644 --- a/utils/ProblemFile/Makefile +++ b/utils/ProblemFile/Makefile @@ -39,17 +39,20 @@ MACROS = # 3.- User defined compilation flags ######################################## FFLAGS=-fPIC +GNU_HPC_FLAGS= -cpp -fallow-argument-mismatch -std=legacy -ffree-line-length-0 -O3 -ftree-vectorize \ + -ftree-vectorizer-verbose=0 -fbackslash -D_has_Quad -march=znver3 -funroll-loops GNU_RELEASE_FLAGS= -cpp -ffree-line-length-0 -O3 -ftree-vectorize -ftree-vectorizer-verbose=0 \ - -fbackslash + -fbackslash -D_has_Quad GNU_DEBUG_FLAGS= -ffree-line-length-0 -cpp -O0 -g -fcheck=all -Wno-unused-variable \ - -fbacktrace -fbounds-check -finit-real=snan -Wall \ - -ffpe-trap=invalid,zero,overflow -fcheck-array-temporaries \ - -fbackslash -fcheck=pointer -INTEL_RELEASE_FLAGS= -cpp -O3 -assume bscc -fp-model precise -INTEL_DEBUG_FLAGS= -cpp -O0 -g -warn all -fpscomp logicals -traceback -check all \ - -check bounds -check uninit -ftrapuv -debug all -warn interfaces \ - -ftrace=full -ftz -fp-model precise \ - -fp-speculation=off -assume bscc + -fbacktrace -fbounds-check -finit-real=snan -Wall \ + -ffpe-trap=invalid,zero,overflow -fcheck-array-temporaries \ + -fbackslash -fcheck=pointer -D_has_Quad +INTEL_HPC_FLAGS= -cpp -Ofast -msse4.2 -axAVX,CORE-AVX2 -assume bscc -D_has_Quad -fp-model=fast=2 -ipo +INTEL_RELEASE_FLAGS= -cpp -O3 -assume bscc -D_has_Quad -fp-model precise +INTEL_DEBUG_FLAGS= -cpp -O0 -g -warn all -fpscomp logicals -traceback \ + -check bounds -check uninit -ftrapuv -debug all \ + -ftrace=full -ftz -fp-model precise \ + -fp-speculation=off -assume bscc -D_has_Quad ARFLAGS=crv TARGET=./libproblemfile @@ -124,6 +127,13 @@ ifeq ($(MODE),RELEASE) else ifeq ($(FC),ifort) FFLAGS+=$(INTEL_RELEASE_FLAGS) endif +else ifeq ($(MODE),HPC) + MACROS+= -D_HPC_MODE + ifeq ($(FC),gfortran) + FFLAGS+=$(GNU_HPC_FLAGS) + else ifeq ($(FC),ifort) + FFLAGS+=$(INTEL_HPC_FLAGS) + endif else ifeq ($(MODE),DEBUG) ifeq ($(FC),gfortran) FFLAGS+=$(GNU_DEBUG_FLAGS)