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

Update Onyx port, update unit test output #617

Merged
merged 1 commit into from
Jul 14, 2021
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
5 changes: 3 additions & 2 deletions cicecore/drivers/unittest/bcstchk/bcstchk.F90
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ program bcstchk
write(6,*) errorflag1(k),stringflag1(k)
enddo
write(6,*) ' '
write(6,*) 'BCSTCHK COMPLETED SUCCESSFULLY'
if (errorflag0 == passflag) then
write(6,*) 'BCSTCHK COMPLETED SUCCESSFULLY'
write(6,*) 'BCSTCHK TEST COMPLETED SUCCESSFULLY'
else
write(6,*) 'BCSTCHK FAILED'
write(6,*) 'BCSTCHK TEST FAILED'
endif
endif

Expand Down
5 changes: 3 additions & 2 deletions cicecore/drivers/unittest/calchk/calchk.F90
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,11 @@ program calchk
1002 format(a,i10,1x,a)

write(6,*) ' '
write(6,*) 'CALCHK COMPLETED SUCCESSFULLY'
if (errorflag0 == passflag) then
write(6,*) 'CALCHK COMPLETED SUCCESSFULLY'
write(6,*) 'CALCHK TEST COMPLETED SUCCESSFULLY'
else
write(6,*) 'CALCHK FAILED'
write(6,*) 'CALCHK TEST FAILED'
endif

end program
Expand Down
3 changes: 2 additions & 1 deletion cicecore/drivers/unittest/helloworld/helloworld.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
program hello_world

write(6,*) 'hello_world'
write(6,*) 'COMPLETED SUCCESSFULLY'
write(6,*) 'hello_world COMPLETED SUCCESSFULLY'
write(6,*) 'hello_world TEST COMPLETED SUCCESSFULLY'

end program

5 changes: 3 additions & 2 deletions cicecore/drivers/unittest/sumchk/sumchk.F90
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,11 @@ program sumchk
write(6,*) errorflag4(k),stringflag4(k)
enddo
write(6,*) ' '
write(6,*) 'SUMCHK COMPLETED SUCCESSFULLY'
if (errorflag0 == passflag) then
write(6,*) 'SUMCHK COMPLETED SUCCESSFULLY'
write(6,*) 'SUMCHK TEST COMPLETED SUCCESSFULLY'
else
write(6,*) 'SUMCHK FAILED'
write(6,*) 'SUMCHK TEST FAILED'
endif
write(6,*) ' '
write(6,*) '=========================================================='
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/cice.run.setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ else
echo "Run completed successfully"
echo "\`date\` \${0}: Run completed successfully" >> \${ICE_CASEDIR}/README.case
else
echo "CICE run did NOT complete"
echo "Run did NOT complete"
echo "\`date\` \${0}: CICE run did NOT complete" >> \${ICE_CASEDIR}/README.case
exit -1
endif
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/machines/Macros.onyx_cray
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#==============================================================================

CPP := ftn -e P
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
CPPDEFS := -DFORTRANUNDERSCORE -DNO_R16 ${ICE_CPPDEFS}
CFLAGS := -c -O2 -h fp0

FIXEDFLAGS := -132
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/machines/Macros.onyx_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CFLAGS := -c

FIXEDFLAGS := -ffixed-line-length-132
FREEFLAGS := -ffree-form
FFLAGS := -fconvert=big-endian -fbacktrace -ffree-line-length-none
FFLAGS := -fconvert=big-endian -fbacktrace -ffree-line-length-none -fallow-argument-mismatch
FFLAGS_NOOPT:= -O0

ifeq ($(ICE_BLDDEBUG), true)
Expand Down
13 changes: 7 additions & 6 deletions configuration/scripts/machines/env.onyx_cray
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@ module unload PrgEnv-cray
module unload PrgEnv-gnu
module unload PrgEnv-intel
module unload PrgEnv-pgi
module load PrgEnv-cray/6.0.4
module load PrgEnv-cray/6.0.9

module unload cce
module load cce/8.6.4
module load cce/11.0.2

module unload cray-mpich
module unload cray-mpich2
module load cray-mpich/7.6.3
module load cray-mpich/7.7.16

module unload netcdf
module unload cray-netcdf
module unload cray-hdf5
module unload cray-hdf5-parallel
module unload cray-netcdf-hdf5parallel
module unload cray-parallel-netcdf
module load cray-netcdf/4.4.1.1.3
module load cray-hdf5/1.10.0.3
module load cray-netcdf/4.7.4.0
module load cray-hdf5/1.12.0.0

module unload cray-libsci
module unload craype-hugepages2M

module load craype-broadwell

Expand All @@ -44,7 +45,7 @@ endif
setenv ICE_MACHINE_MACHNAME onyx
setenv ICE_MACHINE_MACHINFO "Cray XC40/50 Xeon E5-2699v4 Broadwell"
setenv ICE_MACHINE_ENVNAME cray
setenv ICE_MACHINE_ENVINFO "Cray cce/8.6.4, cray-mpich/7.6.3, netcdf/4.4.1.1.3"
setenv ICE_MACHINE_ENVINFO "Cray cce/11.0.2, cray-mpich/7.7.16, netcdf/4.7.4.0"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR $WORKDIR/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /p/app/unsupported/RASM/cice_consortium
Expand Down
13 changes: 7 additions & 6 deletions configuration/scripts/machines/env.onyx_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@ module unload PrgEnv-cray
module unload PrgEnv-gnu
module unload PrgEnv-intel
module unload PrgEnv-pgi
module load PrgEnv-gnu/6.0.4
module load PrgEnv-gnu/6.0.9

module unload gcc
module load gcc/7.2.0
module load gcc/10.2.0

module unload cray-mpich
module unload cray-mpich2
module load cray-mpich/7.6.2
module load cray-mpich/7.7.16

module unload netcdf
module unload cray-netcdf
module unload cray-hdf5
module unload cray-hdf5-parallel
module unload cray-netcdf-hdf5parallel
module unload cray-parallel-netcdf
module load cray-netcdf/4.4.1.1.3
module load cray-hdf5/1.10.0.3
module load cray-netcdf/4.7.4.0
module load cray-hdf5/1.12.0.0

module unload cray-libsci
module unload craype-hugepages2M

module load craype-broadwell

Expand All @@ -44,7 +45,7 @@ endif
setenv ICE_MACHINE_MACHNAME onyx
setenv ICE_MACHINE_MACHINFO "Cray XC40/50 Xeon E5-2699v4 Broadwell"
setenv ICE_MACHINE_ENVNAME gnu
setenv ICE_MACHINE_ENVINFO "GNU Fortran (GCC) 7.2.0 20170814, cray-mpich/7.6.2, netcdf/4.4.1.1.3"
setenv ICE_MACHINE_ENVINFO "GNU Fortran (GCC) 10.2.0, cray-mpich/7.7.16, netcdf/4.7.4.0"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR $WORKDIR/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /p/app/unsupported/RASM/cice_consortium
Expand Down
13 changes: 7 additions & 6 deletions configuration/scripts/machines/env.onyx_intel
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@ module unload PrgEnv-cray
module unload PrgEnv-gnu
module unload PrgEnv-intel
module unload PrgEnv-pgi
module load PrgEnv-intel/6.0.4
module load PrgEnv-intel/6.0.9

module unload intel
module load intel/17.0.1.132
module load intel/19.1.3.304

module unload cray-mpich
module unload cray-mpich2
module load cray-mpich/7.6.2
module load cray-mpich/7.7.16

module unload netcdf
module unload cray-netcdf
module unload cray-hdf5
module unload cray-hdf5-parallel
module unload cray-netcdf-hdf5parallel
module unload cray-parallel-netcdf
module load cray-netcdf/4.4.1.1.3
module load cray-hdf5/1.10.0.3
module load cray-netcdf/4.7.4.0
module load cray-hdf5/1.12.0.0

module unload cray-libsci
module unload craype-hugepages2M

module load craype-broadwell

Expand All @@ -44,7 +45,7 @@ endif
setenv ICE_MACHINE_MACHNAME onyx
setenv ICE_MACHINE_MACHINFO "Cray XC40/50 Xeon E5-2699v4 Broadwell"
setenv ICE_MACHINE_ENVNAME intel
setenv ICE_MACHINE_ENVINFO "ifort 17.0.1 20161005, cray-mpich/7.6.2, netcdf/4.4.1.1.3"
setenv ICE_MACHINE_ENVINFO "ifort 19.1.3.304, cray-mpich/7.7.16, netcdf/4.7.4.0"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR $WORKDIR/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /p/app/unsupported/RASM/cice_consortium
Expand Down
27 changes: 18 additions & 9 deletions configuration/scripts/tests/test_unittest.script
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,33 @@
# cice.run returns -1 if run did not complete successfully

./cice.run
set res="$status"
set rres="$status"

set log_file = `ls -t1 ${ICE_RUNDIR}/cice.runlog* | head -1`

grep ' TEST COMPLETED SUCCESSFULLY' ${log_file}
set tres="$status"

mv -f ${ICE_CASEDIR}/test_output ${ICE_CASEDIR}/test_output.prev
cat ${ICE_CASEDIR}/test_output.prev | grep -iv "${ICE_TESTNAME} run" >! ${ICE_CASEDIR}/test_output
mv -f ${ICE_CASEDIR}/test_output ${ICE_CASEDIR}/test_output.prev
cat ${ICE_CASEDIR}/test_output.prev | grep -iv "${ICE_TESTNAME} test" >! ${ICE_CASEDIR}/test_output
rm -f ${ICE_CASEDIR}/test_output.prev

set grade = PASS
if ( $res != 0 ) then
set grade = FAIL
echo "$grade ${ICE_TESTNAME} run " >> ${ICE_CASEDIR}/test_output
echo "$grade ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output
exit 99
set rgrade = PASS
if ( $rres != 0 ) then
set rgrade = FAIL
endif
set tgrade = PASS
if ( $tres != 0 ) then
set tgrade = FAIL
endif

echo "$grade ${ICE_TESTNAME} run " >> ${ICE_CASEDIR}/test_output
echo "$grade ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output
echo "$rgrade ${ICE_TESTNAME} run " >> ${ICE_CASEDIR}/test_output
echo "$tgrade ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output

if ( "$rgrade" == "FAIL" || "$tgrade" == "FAIL") then
echo "ERROR: Test failed"
exit 99
endif

6 changes: 6 additions & 0 deletions doc/source/user_guide/ug_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,12 @@ in **configuration/scripts/options**. In particular, **ICE_DRVOPT** and
**configuration/scripts/Makefile** and create a target for the unit test.
The unit tests calchk or helloworld can be used as examples.

The following strings should be written to the log file at the end of the unit test run.
The string "COMPLETED SUCCESSFULLY" will indicate the run ran to completion. The string
"TEST COMPLETED SUCCESSFULLY" will indicate all the unit testing passed during the run.
These strings will be queried by the testing scripts and will impact the test reporting.
See other unit tests for examples about how these strings could be written.

The following are brief descriptions of some of the current unit tests,

- **bcstchk** is a unit test that exercises the methods in ice_broadcast.F90. This test does not
Expand Down