Skip to content

Commit

Permalink
Reinstate use of debug tests for linux GNU and Intel (#4)
Browse files Browse the repository at this point in the history
* Scale forcet to prevent negative values passed to log()

This fixes a numerical bug preventing tests from passing
in debug mode.  A bug in ifx giving false positives during
MPI initialization forced turning that debug option off.
Debug tests are now reinstated.

* Turn off assume minus0
  • Loading branch information
christopherwharrop-noaa authored Aug 8, 2024
1 parent 8400e18 commit 67b1564
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/linux_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
run: sudo apt-get install openmpi-bin libopenmpi-dev -y

# Test debug mode
#- name: Build gf debug
# run: |
# cd ref
# rm -rf build
# mkdir build
# cd build
# export OMP_NUM_THREADS=4
# export CC=gcc
# export FC=gfortran
# cmake -DCMAKE_BUILD_TYPE=debug ..
# make
# ctest --output-on-failure
- name: Build gf debug
run: |
cd ref
rm -rf build
mkdir build
cd build
#export OMP_NUM_THREADS=4
export CC=gcc
export FC=gfortran
cmake -DCMAKE_BUILD_TYPE=debug -DENABLE_GPU=off ..
make
ctest --output-on-failure
# Test release mode
- name: Build gf release
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/linux_intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,19 @@ jobs:
uses: actions/checkout@v2

# Test debug mode
#- name: Build gf debug
# run: |
# source /opt/intel/oneapi/setvars.sh
# cd ref
# rm -rf build
# mkdir build
# cd build
# export OMP_NUM_THREADS=4
# export CC=icx
# export FC=ifx
# cmake -DCMAKE_BUILD_TYPE=debug ..
# make
# ulimit -s unlimited
# ctest --output-on-failure
- name: Build gf debug
run: |
source /opt/intel/oneapi/setvars.sh
cd ref
rm -rf build
mkdir build
cd build
#export OMP_NUM_THREADS=4
export CC=icx
export FC=ifx
cmake -DCMAKE_BUILD_TYPE=debug -DENABLE_GPU=off ..
make VERBOSE=1
ctest --output-on-failure
# Test release mode
- name: Build gf release
Expand Down
4 changes: 2 additions & 2 deletions ref/cmake/compiler_flags_Intel_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# COMMON FLAGS
####################################################################

set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fp-model precise " )
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fp-model precise -assume nominus0" )

####################################################################
# RELEASE FLAGS
Expand All @@ -14,7 +14,7 @@ set( CMAKE_Fortran_FLAGS_RELEASE "-O3 -xHost " )
# DEBUG FLAGS
####################################################################

set( CMAKE_Fortran_FLAGS_DEBUG "-O0 -debug -nolib-inline -fno-inline-functions -assume protect_parens,minus0 -prec-div -prec-sqrt -check bounds -check uninit -fp-stack-check -init=snan,array -warn unused" )
set( CMAKE_Fortran_FLAGS_DEBUG "-O0 -debug -nolib-inline -fno-inline-functions -assume protect_parens -prec-div -prec-sqrt -check bounds -fp-stack-check -init=snan,array -warn unused" )

####################################################################
# FLAGS FOR GPUS
Expand Down
1 change: 1 addition & 0 deletions ref/src/gf_test.F90
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ program test_gf
cactiv_m(i) = 1 + mod(i,3)
enddo
CALL mt19937_real2d(forcet(s:e,:))
forcet(s:e,:) = forcet(s:e,:) * 0.001
CALL mt19937_real2d(forceqv_spechum(s:e,:))
CALL mt19937_real2d(phil(s:e,:))
CALL mt19937_real1d(raincv(s:e))
Expand Down
4 changes: 2 additions & 2 deletions test/test_output/output.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST ---------------------------------------------------------------------------
TEST garea 3.2777241431E-03 9.9886531830E+00 4.9934797287E+00 7.8682093620E+00 7.4988007545E+00 2.8921554089E+00
TEST cactiv 1 2 1 2 1 1.0000000000E+00
TEST cactiv_m 1 3 2 2 3 0.0000000000E+00
TEST forcet 2.2139556677E-05 9.9999094009E+00 5.0008244514E+00 3.8052468300E+00 6.1191511154E+00 2.8780047894E+00
TEST forcet 2.2139557743E-08 9.9999094382E-03 5.0008245744E-03 3.8052469026E-03 6.1191515997E-03 2.8780072462E-03
TEST forceqv_spechum 1.5488486679E-04 9.9997625351E+00 5.0179624557E+00 9.9661817551E+00 9.4433851242E+00 2.8892364502E+00
TEST phil 4.9237874919E-05 9.9999685287E+00 5.0032367706E+00 8.3698558807E+00 6.1671215296E-01 2.8890116215E+00
TEST raincv 2.2879648022E-03 9.9959421158E+00 5.1559128761E+00 8.5739431381E+00 2.6720688343E+00 2.9124729633E+00
Expand Down Expand Up @@ -53,7 +53,7 @@ TEST ---------------------------------------------------------------------------
TEST garea 3.2777241431E-03 9.9886531830E+00 4.9934797287E+00 7.8682093620E+00 7.4988007545E+00 2.8921554089E+00
TEST cactiv 0 0 0 0 0 0.0000000000E+00
TEST cactiv_m 0 0 0 0 0 0.0000000000E+00
TEST forcet 2.2139556677E-05 9.9999094009E+00 5.0008244514E+00 3.8052468300E+00 6.1191511154E+00 2.8780047894E+00
TEST forcet 2.2139557743E-08 9.9999094382E-03 5.0008245744E-03 3.8052469026E-03 6.1191515997E-03 2.8780072462E-03
TEST forceqv_spechum 1.5488486679E-04 9.9997625351E+00 5.0179624557E+00 9.9661817551E+00 9.4433851242E+00 2.8892364502E+00
TEST phil 4.9237874919E-05 9.9999685287E+00 5.0032367706E+00 8.3698558807E+00 6.1671215296E-01 2.8890116215E+00
TEST raincv 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00
Expand Down

0 comments on commit 67b1564

Please sign in to comment.