Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/supercomputing flags #183

Merged
merged 5 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Solver/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions Solver/src/libs/monitors/ResidualsMonitor.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified doc/UserManual.pdf
Binary file not shown.
6 changes: 4 additions & 2 deletions doc/UserManual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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.
Expand Down Expand Up @@ -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}
Expand Down
28 changes: 19 additions & 9 deletions utils/ProblemFile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down