Skip to content

Commit

Permalink
Update derecho gnu to add coverage capability with lcov (#1003)
Browse files Browse the repository at this point in the history
Update derecho gnu to support code coverage testing

    Update to ncarenv/24.12 and gcc/12.4.0
    Add coverage compiler flags
    Update lcov scripting as needed

As part of the CICE port to the new coverage tools, a bug was found in the tools that requires debug flags to be disabled when compiling with coverage flags. This was not the case when coverage was running on cheyenne. See linux-test-project/lcov#385
  • Loading branch information
apcraig authored Jan 17, 2025
1 parent 4764d4d commit bfac934
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ cp ${rundir}/compile/*.{gcno,gcda} ${testname_base}/codecov_output/
EOF
cat >> ${tsdir}/report_lcov.csh << EOF
lcov --gcov-tool gcov -c -d ${rundir}/compile -o ${testname_base}/lcov.info
lcov --gcov-tool gcov -c --rc geninfo_unexecuted_blocks=1 -d ${rundir}/compile -o ${testname_base}/lcov.info
if (-s ${testname_base}/lcov.info) then
set lcovalist = "\${lcovalist} -a ${testname_base}/lcov.info"
endif
Expand Down
16 changes: 6 additions & 10 deletions configuration/scripts/machines/Macros.derecho_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@ FREEFLAGS := -ffree-form
FFLAGS := -fconvert=big-endian -fbacktrace -ffree-line-length-none -fallow-argument-mismatch
FFLAGS_NOOPT:= -O0

ifeq ($(ICE_BLDDEBUG), true)
FFLAGS += -O0 -g -fcheck=bounds -finit-real=nan -fimplicit-none -ffpe-trap=invalid,zero,overflow --std f2008
# FFLAGS += -O0 -g -fcheck=all -finit-real=snan -fimplicit-none -ffpe-trap=invalid,zero,overflow
CFLAGS += -O0
endif

ifeq ($(ICE_COVERAGE), true)
FFLAGS += -O0 -g -fprofile-arcs -ftest-coverage
CFLAGS += -O0 -g -coverage
LDFLAGS += -g -ftest-coverage -fprofile-arcs
endif

ifneq ($(ICE_BLDDEBUG), true)
ifneq ($(ICE_COVERAGE), true)
else
ifeq ($(ICE_BLDDEBUG), true)
FFLAGS += -O0 -g -fcheck=bounds -finit-real=nan -fimplicit-none -ffpe-trap=invalid,zero,overflow --std f2008
# FFLAGS += -O0 -g -fcheck=all -finit-real=snan -fimplicit-none -ffpe-trap=invalid,zero,overflow
CFLAGS += -O0
else
FFLAGS += -O2
CFLAGS += -O2
endif
Expand Down
20 changes: 10 additions & 10 deletions configuration/scripts/machines/env.derecho_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ if ("$inp" != "-nomodules") then
source ${MODULESHOME}/init/csh

module --force purge
module load ncarenv/23.06
module load ncarenv/24.12
module reset
module load craype
module load gcc/12.2.0
module load gcc/12.4.0
module load ncarcompilers
module load cray-mpich/8.1.25
module load cray-mpich/8.1.29
module load netcdf/4.9.2
#module load hdf5/1.12.2
#module load netcdf-mpi/4.9.2

module load cray-libsci/23.02.1.1
module load cray-libsci/24.03.0

if ($?ICE_IOTYPE) then
if ($ICE_IOTYPE =~ pio*) then
module unload netcdf
module load netcdf-mpi/4.9.2
module load parallel-netcdf/1.12.3
module load parallel-netcdf/1.14.0
if ($ICE_IOTYPE == "pio1") then
module load parallelio/1.10.1
else
module load parallelio/2.6.2
module load parallelio/2.6.3
endif
endif
endif

module load lcov

if ($?ICE_BFBTYPE) then
if ($ICE_BFBTYPE =~ qcchk*) then
module load conda
Expand Down Expand Up @@ -61,7 +61,7 @@ setenv OMP_STACKSIZE 64M
setenv ICE_MACHINE_MACHNAME derecho
setenv ICE_MACHINE_MACHINFO "HPE Cray EX Milan Slingshot 11"
setenv ICE_MACHINE_ENVNAME gnu
setenv ICE_MACHINE_ENVINFO "gcc 12.2.0 20220819, cray-mpich 8.1.25, netcdf4.9.2, pnetcdf1.12.3, pio1.10.1, pio2.6.2"
setenv ICE_MACHINE_ENVINFO "gcc 12.4.0, cray-mpich 8.1.29, netcdf4.9.2, pnetcdf1.14.0, pio1.10.1, pio2.6.3"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /glade/campaign/cesm/development/pcwg
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/tests/cice.lcov.csh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cp -p -r ${lcovhtmldir} ${lcovrepo}/

cd ${lcovrepo}
set covp0 = `grep message coverage.json | cut -d : -f 2 | cut -d \" -f 2 | cut -d % -f 1`
set covp = `grep -i headerCovTableEntry ${lcovhtmldir}/index.html | grep % | head -1 | cut -d \> -f 2 | cut -d % -f 1`
set covp = `grep -i headerCovTableEntry ${lcovhtmldir}/index.html | grep % | head -1 | cut -d \> -f 2 | cut -d \& -f 1`
set covpi = `echo $covp | cut -d . -f 1`

set lcovhtmlname = "${covpi}%:${report_name}"
Expand Down

0 comments on commit bfac934

Please sign in to comment.