diff --git a/scripts/Testing/Testcases/config_tests.xml b/scripts/Testing/Testcases/config_tests.xml index 750c6fc3439c..d0ddac2690d9 100644 --- a/scripts/Testing/Testcases/config_tests.xml +++ b/scripts/Testing/Testcases/config_tests.xml @@ -367,7 +367,10 @@ LII CLM initial condition interpolation test 1 TRUE TRUE - never + FALSE + none + $STOP_OPTION + $STOP_N 1 FALSE diff --git a/utils/python/CIME/SystemTests/pet.py b/utils/python/CIME/SystemTests/pet.py index 4810f72cb381..aae40508fcf5 100644 --- a/utils/python/CIME/SystemTests/pet.py +++ b/utils/python/CIME/SystemTests/pet.py @@ -6,63 +6,41 @@ (2) do another initial run with nthrds=1 for all components (suffix: single_thread) """ -import shutil from CIME.XML.standard_module_setup import * from CIME.case_setup import case_setup -from CIME.SystemTests.system_tests_common import SystemTestsCommon +from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo logger = logging.getLogger(__name__) -class PET(SystemTestsCommon): +class PET(SystemTestsCompareTwo): + + _COMPONENT_LIST = ('ATM','CPL','OCN','WAV','GLC','ICE','ROF','LND') def __init__(self, case): """ initialize a test object """ - SystemTestsCommon.__init__(self, case) + SystemTestsCompareTwo.__init__(self, case, + separate_builds = False, + run_two_suffix = 'single_thread', + run_one_description = 'default threading', + run_two_description = 'threads set to 1') - def build_phase(self, sharedlib_only=False, model_only=False): + def _case_one_setup(self): # first make sure that all components have threaded settings - for comp in ['ATM','CPL','OCN','WAV','GLC','ICE','ROF','LND']: + for comp in self._COMPONENT_LIST: if self._case.get_value("NTHRDS_%s"%comp) <= 1: self._case.set_value("NTHRDS_%s"%comp, 2) - self._case.flush() + # TODO(wjs, 2016-08-16) Is this needed? I'm thinking it may be because + # we changed the number of threads, but I'm not sure case_setup(self._case, reset=True) - self.clean_build() - self.build_indv(sharedlib_only=sharedlib_only, model_only=model_only) - - def _pet_first_phase(self): - #Do a run with default threading - self._case.set_value("CONTINUE_RUN",False) - self._case.set_value("REST_OPTION","none") - self._case.set_value("HIST_OPTION","$STOP_OPTION") - self._case.set_value("HIST_N","$STOP_N") - self._case.flush() - - stop_n = self._case.get_value("STOP_N") - stop_option = self._case.get_value("STOP_OPTION") - logger.info("doing a %d %s initial test with default threading, no restarts written" - % (stop_n, stop_option)) - - self.run_indv() - - def _pet_second_phase(self): + def _case_two_setup(self): #Do a run with all threads set to 1 - for comp in ['ATM','CPL','OCN','WAV','GLC','ICE','ROF','LND']: + for comp in self._COMPONENT_LIST: self._case.set_value("NTHRDS_%s"%comp, 1) - self._case.flush() - shutil.copy("env_mach_pes.xml", os.path.join("LockedFiles","env_mach_pes.xml")) - - stop_n = self._case.get_value("STOP_N") - stop_option = self._case.get_value("STOP_OPTION") - logger.info("doing a %d %s initial test with threads set to 1, no restarts written" - % (stop_n, stop_option)) - self.run_indv(suffix="single_thread") - self._component_compare_test("base", "single_thread") - - def run_phase(self): - self._pet_first_phase() - self._pet_second_phase() + # TODO(wjs, 2016-08-16) Is this needed? I'm thinking it may be because + # we changed the number of threads, but I'm not sure + case_setup(self._case, reset=True)