Skip to content

Commit 65dc024

Browse files
committed
Add e3sm_atm_nbfb comparison results to TestStatus.log
EVV results will be reported to TestStatus.log which is what gets displayed on CDASH instead of just to the test stdout
1 parent fd6c59c commit 65dc024

File tree

4 files changed

+150
-79
lines changed

4 files changed

+150
-79
lines changed

scripts/climate_reproducibility/README.md

Lines changed: 102 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Climate reproducibility testing
2-
===============================
1+
# Climate reproducibility testing
32

43
Requiring model changes to pass stringent tests before being accepted as part of E3SM’s main development
54
branch is critical for quickly and efficiently producing a trustworthy model. Depending on their
@@ -43,8 +42,7 @@ whether or not non-bit-for-bit (nb4b) model changes are climate changing. The cu
4342

4443

4544

46-
Running the tests
47-
-----------------
45+
## Running the tests
4846

4947
These tests are built into E3SM-CIME as system tests and will be launched using the `create_test` scripts.
5048
*However*, because these tests use high level statistics, they have additional python dependencies which
@@ -79,13 +77,13 @@ directory containing E3SM). Then to run one of the tests, you will use the `crea
7977
To run the `MVK` test and generate a baseline, you would run a command like:
8078

8179
```
82-
./create_test MVK_PL.ne4_oQU240.FC5AV1C-04P2 -g --baseline-root "/PATH/TO/BASELINE"
80+
./create_test MVK_PL.ne4_oQU240.FC5AV1C-L -g --baseline-root "/PATH/TO/BASELINE"
8381
```
8482

8583
And to compare to the baseline, you would run a command like:
8684

8785
```
88-
./create_test MVK_PL.ne4_oQU240.FC5AV1C-04P2 -c --baseline-root "/PATH/TO/BASELINE"
86+
./create_test MVK_PL.ne4_oQU240.FC5AV1C-L -c --baseline-root "/PATH/TO/BASELINE"
8987
```
9088

9189
*NOTE: The MVK run a 20 member ensemble for at least 13 months (using the last 12 for the
@@ -95,34 +93,33 @@ option to `create_test`.*
9593

9694
The full set of commands to run the MVK test used on Cori are:
9795

98-
*Generate a baseline:*
96+
*Generate a baseline*
9997
```
10098
cd $E3SM/cime/scripts
10199
102100
source /global/project/projectdirs/acme/software/anaconda_envs/load_latest_e3sm_simple.sh
103101
104-
./create_test MVK_PL.ne4_ne4.FC5AV1C-04P2 --baseline-root "${CSCRATCH}/baselines" --project acme -g -o --walltime 01:00:00
102+
./create_test MVK_PL.ne4_ne4.FC5AV1C-L --baseline-root "${CSCRATCH}/baselines" --project acme -g -o --walltime 01:00:00
105103
```
106104

107-
*Compare to a baseline:*
105+
*Compare to a baseline*
108106
```
109107
cd $E3SM/cime/scripts
110108
111109
source /global/project/projectdirs/acme/software/anaconda_envs/load_latest_e3sm_simple.sh
112110
113-
./create_test MVK_PL.ne4_ne4.FC5AV1C-04P2 --baseline-root "${CSCRATCH}/baselines" --project acme -c --walltime 01:00:00
111+
./create_test MVK_PL.ne4_ne4.FC5AV1C-L --baseline-root "${CSCRATCH}/baselines" --project acme -c --walltime 01:00:00
114112
```
115113

116-
Test pass/fail and extended output
117-
----------------------------------
114+
## Test pass/fail and extended output
118115

119-
When you launch these tests, CIME will ouput the location of the case directory, which will look
116+
When you launch these tests and compare to a baseline, CIME will output the location of the case directory, which will look
120117
something like this:
121118

122119
```
123120
# On cori-knl:
124-
./create_test MVK_PL.ne4_ne4.FC5AV1C-04P2 --baseline-root "${CSCRATCH}/baselines" --project acme -c --walltime 01:00:00
125-
Creating test directory /global/cscratch1/sd/${USER}/acme_scratch/cori-knl/MVK_PL.ne4_ne4.FC5AV1C-04P2.cori-knl_intel.G.20190807_140111_rhfxn9
121+
./create_test MVK_PL.ne4_ne4.FC5AV1C-L --baseline-root "${CSCRATCH}/baselines" --project acme -c --walltime 01:00:00
122+
Creating test directory /global/cscratch1/sd/${USER}/acme_scratch/cori-knl/MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID
126123
```
127124

128125
Let's call that directory `$CASE_DIR`. Once all the jobs are finished, navigate to that directory and
@@ -132,83 +129,105 @@ you can `cat TestStatus` to determine if the test passed or failed by looking at
132129
cd $CASE_DIR
133130
cat TestStatus
134131
...
135-
PASS MVK_PL.ne4_ne4.FC5AV1C-04P2.cori-knl_intel BASELINE
132+
PASS MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel BASELINE
136133
...
137134
138135
```
139136

140-
To get some basic summary statistics about the test that was run, look in the output of the final job
141-
submission for EVV's analysis:
137+
To get some basic summary statistics about the test that was run, look in the `TestStatus.log` file:
142138

143-
```
144-
view MVK_PL.ne4_ne4.FC5AV1C-04P2.cori-knl_intel.G.20190807_140111_rhfxn9.C.YYYYMMDD_HHMMSS_RANDOMID.test.oJOBID
145-
...
146-
2019-08-14 22:09:02 CASE.RUN HAS FINISHED
147-
--------------------------------------------------------------------
148-
______ __ __ __ __
149-
| ____| \ \ / / \ \ / /
150-
| |__ \ \ / / \ \ / /
151-
| __| \ \/ / \ \/ /
152-
| |____ \ / \ /
153-
|______| \/ \/
154-
155-
Extended Verification and Validation for Earth System Models
156-
--------------------------------------------------------------------
157-
158-
Current run: 2019-08-14 21:51:32
159-
User: ${USER}
160-
OS Type: Linux 4.12.14-25.22_5.0.70-cray_ari_c
161-
Machine: nid06598
162-
163-
-------------------------------------------------------------------
164-
-----------------------------------------------------------------
165-
Beginning extensions test suite
166-
-----------------------------------------------------------------
167-
168-
169-
Kolmogorov-Smirnov test: YYYYMMDD_HHMMSS_RANDOMID
170-
Variables analyzed: 378
171-
Rejecting: 9
172-
Critical value: 13.0
173-
Ensembles: identical
174-
175-
-----------------------------------------------------------------
176-
Extensions test suite complete
177-
-----------------------------------------------------------------
178-
179-
-------------------------------------------------------------------
180-
Done! Results can be seen in a web browser at:
181-
/global/cscratch1/sd/${USER}/acme_scratch/cori-knl/MVK_PL.ne4_ne4.FC5AV1C-04P2.cori-knl_intel.G.20190807_140111_rhfxn9/run/MVK_PL.ne4_ne4.FC5AV1C-04P2.cori-knl_intel.G.20190807_140111_rhfxn9.evv/index.html
182-
-------------------------------------------------------------------
183-
...
139+
```
140+
2019-08-14 22:09:02: BASELINE PASS for test 'YYYYMMDD_HHMMSS_RANDOMID'.
141+
Case: YYYYMMDD_HHMMSS_RANDOMID; Test status: pass; Variables analyzed: 118; Rejecting: 0; Critical value: 13; Ensembles: statistically identical
142+
EVV results can be viewed at: /global/cscratch1/sd/${USER}/acme_scratch/cori-knl/MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID/run/MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID.evv/
143+
EVV viewing instructions can be found at: https://github.com/E3SM-Project/E3SM/blob/master/cime/scripts/climate_reproducibility/README.md#test-passfail-and-extended-output
184144
```
185145

186-
EVV also prints the location of the output website where you can see the details of the analysis. For
146+
EVV reports the location of the output website where you can see the details of the analysis. For
187147
the MVK test, you will be able to view per variable Q-Q plots, P-P plots, the K-S test statistic, and
188148
whether it rejects or accepts the null hypothesis, as well as a description of the test itself -- you
189149
can see an example of the output website [here](http://livvkit.github.io/evv4esm/).
190150

191-
Please note: the output website uses some JavaScript to render elements of the page (especially figures),
192-
and opening up the `index.html` file using the `file://` protocol in a web browser will likely not work
193-
well (most browser have stopped allowing access to "local resources" like JavaScript through the `file://`
194-
protocol). You can view the website by either copying it to a hosted location (`~/WWW` which is hosted at
195-
`http://users.nccs.gov/~user` on Titan, for example) or copying it to your local machine and running a
196-
local http server (included in python!) and viewing it through an address like `http://0.0.0.0:8000/index.html`.
151+
To view the website, you can either tunnel the website to your local machine through ssh, or copy
152+
the website directory to your machine and view it using EVV.
153+
154+
### View via ssh
155+
156+
For this example, we'll assume the tests were run on Cori at NERSC, but these instructions should be
157+
easily adaptable to any E3SM supported machine. First, log into Cori via ssh and connect your local
158+
8080 port to the 8080 port on Cori:
159+
160+
```
161+
ssh -L 8080:localhost:8080 [USER]@cori.nersc.gov
162+
```
163+
164+
Activate the `e3sm_simple` environment:
165+
166+
```
167+
source /global/project/projectdirs/acme/software/anaconda_envs/load_latest_e3sm_simple.sh
168+
```
169+
170+
Navigate to the case's run directory:
171+
172+
```
173+
pushd ${CASE_DIR}/run
174+
```
175+
176+
Then, using EVV, serve the website over port 8080:
197177

198-
**For the easiest viewing** we recommend copying the website to your local machine, and using EVV to
199-
view it. you can install EVV locally by running this command:
178+
```
179+
evv -o PGN_P1x1.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID.evv -s 8080
180+
```
181+
182+
Evv will then report to you the URL where you can view the website:
183+
184+
```
185+
186+
--------------------------------------------------------------------
187+
______ __ __ __ __
188+
| ____| \ \ / / \ \ / /
189+
| |__ \ \ / / \ \ / /
190+
| __| \ \/ / \ \/ /
191+
| |____ \ / \ /
192+
|______| \/ \/
193+
194+
Extended Verification and Validation for Earth System Models
195+
--------------------------------------------------------------------
196+
197+
Current run: 2019-08-27 14:16:49
198+
User: kennedyj
199+
OS Type: Linux 4.12.14-150.27-default
200+
Machine: cori07
201+
202+
203+
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/)
204+
205+
View the generated website by navigating to:
206+
207+
http://0.0.0.0:8080/PGN_P1x1.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID.evv/index.html
208+
209+
Exit by pressing `ctrl+c` to send a keyboard interrupt.
210+
```
211+
212+
You can now either click that link or copy-paste that link into your favorite web
213+
browser to view the output website.
214+
215+
### View a local copy
216+
217+
For this example, we'll assume the tests were run on Cori at NERSC, but these instructions should be
218+
easily adaptable to any E3SM supported machine. Install `e3sm_simple` locally and activate it:
200219

201220
```
202-
conda install evv4esm
221+
conda create -n e3sm_simple -c conda-forge -c e3sm e3sm-simple
222+
conda activate e3sm_simple
203223
```
204224

205225
Then, copy the website to your local machine, and view it:
206226

207-
208227
```
209228
# on your local machine
210-
scp -r /lustre/atlas/proj-shared/cli115/$USER/MVK_PL.ne4_oQU240.FC5AV1C-04P2.titan_pgi.C.YYYYMMDD_HHMMSS_RANDOMID/run/MVK_PL.ne4_oQU240.FC5AV1C-04P2.titan_pgi.C.YYYYMMDD_HHMMSS_RANDOMID.eve .
211-
evv -o MVK_PL.ne4_oQU240.FC5AV1C-04P2.titan_pgi.C.YYYYMMDD_HHMMSS_RANDOMID.evv -s
229+
scp -r /global/cscratch1/sd/${USER}/acme_scratch/cori-knl/MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID/run/MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID.evv .
230+
evv -o MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID.evv -s
212231
--------------------------------------------------------------------
213232
______ __ __ __ __
214233
| ____| \ \ / / \ \ / /
@@ -230,9 +249,19 @@ evv -o MVK_PL.ne4_oQU240.FC5AV1C-04P2.titan_pgi.C.YYYYMMDD_HHMMSS_RANDOMID.evv -
230249
231250
View the generated website by navigating to:
232251
233-
http://0.0.0.0:8000/MVK_PL.ne4_oQU240.FC5AV1C-04P2.titan_pgi.C.YYYYMMDD_HHMMSS_RANDOMID.evv/index.html
252+
http://0.0.0.0:8000/MVK_PL.ne4_ne4.FC5AV1C-L.cori-knl_intel.C.YYYYMMDD_HHMMSS_RANDOMID.evv/index.html
234253
235254
Exit by pressing `ctrl+c` to send a keyboard interrupt.
236255
237256
```
238257

258+
You can now either click that link or copy-paste that link into your favorite web
259+
browser to view the output website.
260+
261+
262+
**Please note:** the output website uses some JavaScript to render elements of the page (especially figures),
263+
and opening up the `index.html` file using the `file://` protocol in a web browser will likely not work
264+
well (most browser have stopped allowing access to "local resources" like JavaScript through the `file://`
265+
protocol). You can view the website by either copying it to a hosted location (`~/WWW` which is hosted at
266+
`http://users.nccs.gov/~user` on Titan, for example) or copying it to your local machine and running a
267+
local http server (included in python!) and viewing it through an address like `http://0.0.0.0:8000/index.html`.

scripts/lib/CIME/SystemTests/mvk.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from CIME.SystemTests.system_tests_common import SystemTestsCommon
1515
from CIME.case.case_setup import case_setup
1616
from CIME.hist_utils import _get_all_hist_files
17-
from CIME.utils import safe_copy, SharedArea
17+
from CIME.utils import safe_copy, SharedArea, append_testlog
1818

1919
import evv4esm # pylint: disable=import-error
2020
from evv4esm.__main__ import main as evv # pylint: disable=import-error
@@ -133,10 +133,24 @@ def _compare_baseline(self):
133133
with open(os.path.join(evv_out_dir, 'index.json')) as evv_f:
134134
evv_status = json.load(evv_f)
135135

136+
comments = ""
136137
for evv_elem in evv_status['Data']['Elements']:
137138
if evv_elem['Type'] == 'ValSummary' \
138139
and evv_elem['TableTitle'] == 'Kolmogorov-Smirnov test':
140+
comments = "; ".join("{}: {}".format(key, val) for key, val
141+
in evv_elem['Data'][test_name][''].items())
139142
if evv_elem['Data'][test_name]['']['Test status'].lower() == 'pass':
140143
self._test_status.set_status(CIME.test_status.BASELINE_PHASE,
141144
CIME.test_status.TEST_PASS_STATUS)
142-
break
145+
break
146+
147+
status = self._test_status.get_status(CIME.test_status.BASELINE_PHASE)
148+
comments = "{} {} for test '{}'.\n" \
149+
" {}\n" \
150+
" EVV results can be viewed at: {}\n" \
151+
" EVV viewing instructions can be found at: " \
152+
" https://github.com/E3SM-Project/E3SM/blob/master/cime/scripts/" \
153+
"climate_reproducibility/README.md#test-passfail-and-extended-output" \
154+
"".format(CIME.test_status.BASELINE_PHASE, status, test_name, comments, evv_out_dir)
155+
156+
append_testlog(comments, self._orig_caseroot)

scripts/lib/CIME/SystemTests/pgn.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import CIME.test_status
2323
from CIME.SystemTests.system_tests_common import SystemTestsCommon
2424
from CIME.case.case_setup import case_setup
25-
from CIME.utils import expect
25+
from CIME.utils import expect, append_testlog
2626

2727
import evv4esm # pylint: disable=import-error
2828
from evv4esm.extensions import pg # pylint: disable=import-error
@@ -173,13 +173,27 @@ def _compare_baseline(self):
173173
with open(os.path.join(evv_out_dir, 'index.json'), 'r') as evv_f:
174174
evv_status = json.load(evv_f)
175175

176+
comments = ""
176177
for evv_elem in evv_status['Data']['Elements']:
177178
if evv_elem['Type'] == 'ValSummary' \
178179
and evv_elem['TableTitle'] == 'Perturbation growth test':
180+
comments = "; ".join("{}: {}".format(key, val) for key, val
181+
in evv_elem['Data'][test_name][''].items())
179182
if evv_elem['Data'][test_name]['']['Test status'].lower() == 'pass':
180183
self._test_status.set_status(CIME.test_status.BASELINE_PHASE,
181184
CIME.test_status.TEST_PASS_STATUS)
182-
break
185+
break
186+
187+
status = self._test_status.get_status(CIME.test_status.BASELINE_PHASE)
188+
comments = "{} {} for test '{}'.\n" \
189+
" {}\n" \
190+
" EVV results can be viewed at: {}\n" \
191+
" EVV viewing instructions can be found at: " \
192+
" https://github.com/E3SM-Project/E3SM/blob/master/cime/scripts/" \
193+
"climate_reproducibility/README.md#test-passfail-and-extended-output" \
194+
"".format(CIME.test_status.BASELINE_PHASE, status, test_name, comments, evv_out_dir)
195+
196+
append_testlog(comments, self._orig_caseroot)
183197

184198
def run_phase(self):
185199
logger.debug("PGN_INFO: RUN PHASE")

scripts/lib/CIME/SystemTests/tsc.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from CIME.SystemTests.system_tests_common import SystemTestsCommon
1616
from CIME.case.case_setup import case_setup
1717
from CIME.hist_utils import rename_all_hist_files, _get_all_hist_files
18-
from CIME.utils import safe_copy, SharedArea
18+
from CIME.utils import safe_copy, SharedArea, append_testlog
1919

2020
import evv4esm # pylint: disable=import-error
2121
from evv4esm.__main__ import main as evv # pylint: disable=import-error
@@ -151,13 +151,27 @@ def _compare_baseline(self):
151151
with open(os.path.join(evv_out_dir, 'index.json'), 'r') as evv_f:
152152
evv_status = json.load(evv_f)
153153

154+
comments = ""
154155
for evv_elem in evv_status['Data']['Elements']:
155156
if evv_elem['Type'] == 'ValSummary' \
156157
and evv_elem['TableTitle'] == 'Time step convergence test':
158+
comments = "; ".join("{}: {}".format(key, val) for key, val
159+
in evv_elem['Data'][test_name][''].items())
157160
if evv_elem['Data'][test_name]['']['Test status'].lower() == 'pass':
158161
self._test_status.set_status(CIME.test_status.BASELINE_PHASE,
159162
CIME.test_status.TEST_PASS_STATUS)
160-
break
163+
break
164+
165+
status = self._test_status.get_status(CIME.test_status.BASELINE_PHASE)
166+
comments = "{} {} for test '{}'.\n" \
167+
" {}\n" \
168+
" EVV results can be viewed at: {}\n" \
169+
" EVV viewing instructions can be found at: " \
170+
" https://github.com/E3SM-Project/E3SM/blob/master/cime/scripts/" \
171+
"climate_reproducibility/README.md#test-passfail-and-extended-output" \
172+
"".format(CIME.test_status.BASELINE_PHASE, status, test_name, comments, evv_out_dir)
173+
174+
append_testlog(comments, self._orig_caseroot)
161175

162176
def _generate_baseline(self):
163177
super(TSC, self)._generate_baseline()

0 commit comments

Comments
 (0)