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

Erp to restart tests #1857

Merged
merged 3 commits into from
Sep 1, 2017
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
31 changes: 9 additions & 22 deletions scripts/lib/CIME/SystemTests/erp.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"):
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions scripts/lib/CIME/SystemTests/system_tests_compare_two.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down