SETTE test failures from automatically generated architecture configurations
Context
The use of architecture configuration files generated automatically by script arch/build_arch-auto.sh
of branches branch_5.0
, branch_4.2
, and main
for building NEMO with the GCC compiler family in production mode has been found to result in the failure of SETTE tests for many (but not all) SETTE configurations.
Analysis and fix
A reduction of the optimisation level as
--- a/arch/build_arch-auto.sh
+++ b/arch/build_arch-auto.sh
@@ -454,7 +454,7 @@ case "$ftncomp" in
" If it is not the case, replace -xHost by the appropiate option in PROD_FCFLAGS"
;;
gnu)
- PROD_FCFLAGS="-fdefault-real-8 -O3 -march=native -funroll-all-loops -fcray-pointer -ffree-line-length-none"
+ PROD_FCFLAGS="-fdefault-real-8 -O1 -march=native -funroll-all-loops -fcray-pointer -ffree-line-length-none"
DEBUG_FCFLAGS="-fdefault-real-8 -Og -g -fbacktrace -funroll-all-loops -fcray-pointer -ffree-line-length-none -fcheck=all -finit-real=nan -ffpe-trap=invalid,zero,overflow -ffpe-summary=invalid,zero,overflow"
rev=$( $FCnemo --version | head -n 1 | sed -e "s/.* \([0-9]*\).*/\1/" )
# if gfortran version >= 10 : add -fallow-argument-mismatch
would restore successful SETTE testing for all SETTE configurations when building with a Fortran compiler from major version 12 of the GCC compiler family and using the corresponding automatically generated architecture file; when testing branch branch_4.2
a reduction to -O2
would be sufficient. However, such reduction would unnecessarily deactivate suitable optimisations when building the model executable in production mode, and thus the selective deactivation of solely a small set of specific optimisations from those enabled with the -O3
compiler option in order to restore successful SETTE testing would be preferable.