From e58e47a7fd5740252e48d8c07311bdc0ed19bec8 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 31 Aug 2017 13:14:02 -0600 Subject: [PATCH 1/3] merge with restart_tests work recently added to master --- scripts/lib/CIME/SystemTests/erp.py | 29 +++++-------------- .../SystemTests/system_tests_compare_two.py | 10 +++---- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/scripts/lib/CIME/SystemTests/erp.py b/scripts/lib/CIME/SystemTests/erp.py index 05021bbda31..358d67c26f5 100644 --- a/scripts/lib/CIME/SystemTests/erp.py +++ b/scripts/lib/CIME/SystemTests/erp.py @@ -10,31 +10,26 @@ from CIME.XML.standard_module_setup import * from CIME.case_setup import case_setup -from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo +from CIME.SystemTests.restart_tests import RestartTest from CIME.check_lockedfiles import * logger = logging.getLogger(__name__) -class ERP(SystemTestsCompareTwo): +class ERP(RestartTest): def __init__(self, case): """ initialize a test object """ - SystemTestsCompareTwo.__init__(self, case, - separate_builds = True, - run_two_suffix = 'rest', - run_one_description = 'initial', - run_two_description = 'restart') + RestartTest.__init__(self, case, + separate_builds = True, + run_two_suffix = 'rest', + run_one_description = 'initial', + run_two_description = 'restart') def _common_setup(self): self._case.set_value("BUILD_THREADED",True) - def _case_one_setup(self): - stop_n = self._case.get_value("STOP_N") - - expect(stop_n > 2, "ERROR: stop_n value {:d} too short".format(stop_n)) - def _case_two_setup(self): # halve the number of tasks and threads for comp in self._case.get_values("COMP_CLASSES"): @@ -47,15 +42,7 @@ def _case_two_setup(self): self._case.set_value("NTASKS_{}".format(comp), ntasks/2) self._case.set_value("ROOTPE_{}".format(comp), rootpe/2) - stop_n = self._case1.get_value("STOP_N") - rest_n = self._case1.get_value("REST_N") - stop_new = stop_n - rest_n - expect(stop_new > 0, "ERROR: stop_n value {:d} too short {:d} {:d}".format(stop_new,stop_n,rest_n)) - self._case.set_value("STOP_N", stop_new) - self._case.set_value("HIST_N", stop_n) - self._case.set_value("CONTINUE_RUN", True) - self._case.set_value("REST_OPTION","never") - + RestartTest._case_two_setup(self) # Note, some components, like CESM-CICE, have # decomposition information in env_build.xml that # needs to be regenerated for the above new tasks and thread counts diff --git a/scripts/lib/CIME/SystemTests/system_tests_compare_two.py b/scripts/lib/CIME/SystemTests/system_tests_compare_two.py index 1ec2569443e..34638e26c85 100644 --- a/scripts/lib/CIME/SystemTests/system_tests_compare_two.py +++ b/scripts/lib/CIME/SystemTests/system_tests_compare_two.py @@ -229,12 +229,12 @@ def run_phase(self, success_change=False): # pylint: disable=arguments-differ self.run_indv(suffix = self._run_two_suffix) self._case_two_custom_postrun_action() - # Compare results - # Case1 is the "main" case, and we need to do the comparisons from there - self._activate_case1() - self._link_to_case2_output() + # Compare results + # Case1 is the "main" case, and we need to do the comparisons from there + self._activate_case1() + self._link_to_case2_output() - self._component_compare_test(self._run_one_suffix, self._run_two_suffix, success_change=success_change) + self._component_compare_test(self._run_one_suffix, self._run_two_suffix, success_change=success_change) def copy_case1_restarts_to_case2(self): """ From 7803208f2a7e1b7bdb09f5cd6b62684229dbdd47 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 31 Aug 2017 14:02:52 -0600 Subject: [PATCH 2/3] fix comment --- scripts/lib/CIME/SystemTests/erp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/CIME/SystemTests/erp.py b/scripts/lib/CIME/SystemTests/erp.py index 358d67c26f5..56bddf10b2a 100644 --- a/scripts/lib/CIME/SystemTests/erp.py +++ b/scripts/lib/CIME/SystemTests/erp.py @@ -1,5 +1,5 @@ """ -CIME ERP test. This class inherits from SystemTestsCompareTwo +CIME ERP test. This class inherits from RestartTest This is a pes counts hybrid (open-MP/MPI) restart bfb test from startup. This is just like an ERS test but the pe-counts/threading From 082827cb5e6bb97c6ed04a856642d506630196af Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 31 Aug 2017 17:24:26 -0600 Subject: [PATCH 3/3] fix indentation --- .../lib/CIME/SystemTests/system_tests_compare_two.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/lib/CIME/SystemTests/system_tests_compare_two.py b/scripts/lib/CIME/SystemTests/system_tests_compare_two.py index 34638e26c85..27b26687145 100644 --- a/scripts/lib/CIME/SystemTests/system_tests_compare_two.py +++ b/scripts/lib/CIME/SystemTests/system_tests_compare_two.py @@ -229,12 +229,12 @@ def run_phase(self, success_change=False): # pylint: disable=arguments-differ self.run_indv(suffix = self._run_two_suffix) self._case_two_custom_postrun_action() - # Compare results - # Case1 is the "main" case, and we need to do the comparisons from there - self._activate_case1() - self._link_to_case2_output() + # Compare results + # Case1 is the "main" case, and we need to do the comparisons from there + self._activate_case1() + self._link_to_case2_output() - self._component_compare_test(self._run_one_suffix, self._run_two_suffix, success_change=success_change) + self._component_compare_test(self._run_one_suffix, self._run_two_suffix, success_change=success_change) def copy_case1_restarts_to_case2(self): """