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

cice.test should call cice.run with -nomodules #695

Closed
phil-blain opened this issue Mar 3, 2022 · 2 comments
Closed

cice.test should call cice.run with -nomodules #695

phil-blain opened this issue Mar 3, 2022 · 2 comments

Comments

@phil-blain
Copy link
Member

I had some trouble with our new compiler installation that does not like to be initialized twice, which is the case with tests (and thus suites) because env.$machine_$compiler is sourced by cice.test and then again in cice.run (which is ran form cice.test).

In anycase it should make everything slightly faster if the environment setup is done only once.

So basically, something like this:

diff --git i/configuration/scripts/tests/test_decomp.script w/configuration/scripts/tests/test_decomp.script
index bc45e3c..2b5d630 100644
--- i/configuration/scripts/tests/test_decomp.script
+++ w/configuration/scripts/tests/test_decomp.script
@@ -26,7 +26,7 @@ foreach decomp (${decomps})
   ${ICE_CASEDIR}/casescripts/parse_namelist.sh ice_in ${ICE_CASEDIR}/casescripts/set_nml.d${decomp}
   cp ice_in ice_in.${decomp}
 
-  ./cice.run
+  ./cice.run -nomodules
   set res="$status"
 
   set grade = FAIL
diff --git i/configuration/scripts/tests/test_logbfb.script w/configuration/scripts/tests/test_logbfb.script
index 0ac1ed2..7e8948c 100644
--- i/configuration/scripts/tests/test_logbfb.script
+++ w/configuration/scripts/tests/test_logbfb.script
@@ -3,7 +3,7 @@
 # Run the CICE model
 # cice.run returns -1 if run did not complete successfully
 
-./cice.run
+./cice.run -nomodules
 set res="$status"
 
 set log_file = `ls -t1 ${ICE_RUNDIR}/cice.runlog* | head -1`
diff --git i/configuration/scripts/tests/test_qcchk.script w/configuration/scripts/tests/test_qcchk.script
index 81b5f05..1ccadaa 100644
--- i/configuration/scripts/tests/test_qcchk.script
+++ w/configuration/scripts/tests/test_qcchk.script
@@ -6,7 +6,7 @@ cp ${ICE_SANDBOX}/configuration/scripts/tests/QC/CICE_Lookup_Table_p0.8_n1825.nc
 # Run the CICE model
 # cice.run returns -1 if run did not complete successfully
 
-./cice.run
+./cice.run -nomodules
 set res="$status"
 
 set log_file = `ls -t1 ${ICE_RUNDIR}/cice.runlog* | head -1`
diff --git i/configuration/scripts/tests/test_qcchkf.script w/configuration/scripts/tests/test_qcchkf.script
index 81b5f05..1ccadaa 100644
--- i/configuration/scripts/tests/test_qcchkf.script
+++ w/configuration/scripts/tests/test_qcchkf.script
@@ -6,7 +6,7 @@ cp ${ICE_SANDBOX}/configuration/scripts/tests/QC/CICE_Lookup_Table_p0.8_n1825.nc
 # Run the CICE model
 # cice.run returns -1 if run did not complete successfully
 
-./cice.run
+./cice.run -nomodules
 set res="$status"
 
 set log_file = `ls -t1 ${ICE_RUNDIR}/cice.runlog* | head -1`
diff --git i/configuration/scripts/tests/test_restart.script w/configuration/scripts/tests/test_restart.script
index 59729b3..74f97d1 100644
--- i/configuration/scripts/tests/test_restart.script
+++ w/configuration/scripts/tests/test_restart.script
@@ -7,7 +7,7 @@ cp ice_in ice_in.0
 ${ICE_CASEDIR}/casescripts/parse_namelist.sh ice_in ${ICE_CASEDIR}/casescripts/test_nml.restart1
 cp ice_in ice_in.1
 
-./cice.run
+./cice.run -nomodules
 set res="$status"
 
 if ( $res != 0 ) then
@@ -44,7 +44,7 @@ perl -i -pe's/(\d{4})-(\d{2})-(\d{2})/sprintf("%04d-%02d-%02d",$1,$2,$3-5)/e' ${
 ${ICE_CASEDIR}/casescripts/parse_namelist.sh ice_in ${ICE_CASEDIR}/casescripts/test_nml.restart2
 cp ice_in ice_in.2
 
-./cice.run
+./cice.run -nomodules
 set res="$status"
 
 cp ice_in.0 ice_in
diff --git i/configuration/scripts/tests/test_smoke.script w/configuration/scripts/tests/test_smoke.script
index 015b0b5..62b57d3 100644
--- i/configuration/scripts/tests/test_smoke.script
+++ w/configuration/scripts/tests/test_smoke.script
@@ -3,7 +3,7 @@
 # Run the CICE model
 # cice.run returns -1 if run did not complete successfully
 
-./cice.run
+./cice.run -nomodules
 set res="$status"
 
 set log_file = `ls -t1 ${ICE_RUNDIR}/cice.runlog* | head -1`
diff --git i/configuration/scripts/tests/test_unittest.script w/configuration/scripts/tests/test_unittest.script
index 1db8dfe..6e2eae0 100644
--- i/configuration/scripts/tests/test_unittest.script
+++ w/configuration/scripts/tests/test_unittest.script
@@ -3,7 +3,7 @@
 # Run the CICE model
 # cice.run returns -1 if run did not complete successfully
 
-./cice.run
+./cice.run -nomodules
 set rres="$status"
 
 set log_file = `ls -t1 ${ICE_RUNDIR}/cice.runlog* | head -1`

is all that should be required. I tested it and it works.

@apcraig

@apcraig apcraig self-assigned this Mar 10, 2022
phil-blain added a commit to phil-blain/CICE that referenced this issue May 24, 2022
Some compiler environments (namely newer version of Intel's oneAPI
toolkit) prevent users form sourcing their initialization script twice,
at least by default.

The CICE test infrastructure currently does this, because
env.$machine_$env is sourced by cice.test and then again by cice.run
(which is ran from cice.test). Sourcing the env file in 'cice.run', when
ran from 'cice.test', is thus unnecessary.

Most env files already support the '-nomodules' flag, which is used by
'cice.setup' when only machine variables are needed, and not a full
compiling environment. Leverage this flag by calling 'cice.run' with
'-nomodules' in 'cice.test'. As a byprodcut, this should make tests run
slightly faster since the environment setup is done only once.

Closes: CICE-Consortium#695
@phil-blain
Copy link
Member Author

See PR #724

@apcraig
Copy link
Contributor

apcraig commented Aug 5, 2022

I'm going to close this for now. We can reopen in the future if more discussion/action is needed.

@apcraig apcraig closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants