Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfouca committed Aug 5, 2016
1 parent 6ca6b59 commit ba69385
Show file tree
Hide file tree
Showing 23 changed files with 514 additions and 533 deletions.
13 changes: 7 additions & 6 deletions scripts/Tools/case.build
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,18 @@ def _main_func(description):
test = find_system_test(testname, case)(case)

append_status("case.testbuild starting ",
caseroot=caseroot,sfile="CaseStatus")
test.build(sharedlib_only=sharedlib_only, model_only=model_only)
caseroot=caseroot,sfile="CaseStatus")
with test:
test.build(sharedlib_only=sharedlib_only, model_only=model_only)
append_status("case.testbuild complete",
caseroot=caseroot,sfile="CaseStatus")
caseroot=caseroot,sfile="CaseStatus")
else:
append_status("case.build starting",
caseroot=caseroot,sfile="CaseStatus")
caseroot=caseroot,sfile="CaseStatus")
build.case_build(caseroot, case=case, sharedlib_only=sharedlib_only,
model_only=model_only)
model_only=model_only)
append_status("case.build complete",
caseroot=caseroot,sfile="CaseStatus")
caseroot=caseroot,sfile="CaseStatus")

if __name__ == "__main__":
_main_func(__doc__)
2 changes: 0 additions & 2 deletions scripts/Tools/component_compgen_baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,5 +348,3 @@ if [ -n "$generate_tag" ]; then
exit 2
fi
fi


29 changes: 11 additions & 18 deletions utils/python/CIME/SystemTests/eri.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, case):
SystemTestsCommon.__init__(self, case)
self._testname = "ERI"

def run(self):
def run_phase(self):
caseroot = self._case.get_value("CASEROOT")
clone1_path = "%s.ref1" % caseroot
clone2_path = "%s.ref2" % caseroot
Expand Down Expand Up @@ -99,10 +99,8 @@ def run(self):
with open("user_nl_cam", "a") as fd:
fd.write("inithist = 'ENDOFRUN'\n")

success = self._run(coupler_log_path=os.path.join(dout_sr1, "logs"),
st_archive=True)
if not success:
return False
self.run_indv(coupler_log_path=os.path.join(dout_sr1, "logs"),
st_archive=True)

#
# (2) Test run:
Expand Down Expand Up @@ -148,11 +146,9 @@ def run(self):

# run ref2 case (all component history files will go to short term archiving)

success = self._run(suffix="hybrid",
coupler_log_path=os.path.join(dout_sr2, "logs"),
st_archive=True)
if not success:
return False
self.run_indv(suffix="hybrid",
coupler_log_path=os.path.join(dout_sr2, "logs"),
st_archive=True)

#
# (3a) Test run:
Expand Down Expand Up @@ -199,9 +195,8 @@ def run(self):
self._component_compare_move("hybrid")

# run branch case (short term archiving is off)
success = self._run()
if not success:
return False
self.run_indv()

#
# (3b) Test run:
# do a restart continue from (3a) (short term archiving off)
Expand All @@ -218,9 +213,7 @@ def run(self):
self._case.flush()

# do the restart run (short term archiving is off)
success = self._run(suffix="rest")
if not success:
return False
self.run_indv(suffix="rest")

return self._component_compare_test("base", "hybrid") and \
self._component_compare_test("base", "rest")
self._component_compare_test("base", "hybrid")
self._component_compare_test("base", "rest")
22 changes: 6 additions & 16 deletions utils/python/CIME/SystemTests/erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def __init__(self, case):
"""
SystemTestsCommon.__init__(self, case)

def build(self, sharedlib_only=False, model_only=False):
def build_phase(self, sharedlib_only=False, model_only=False):
"""
Build two cases. Case one uses defaults, case2 uses half the number of threads
and tasks. This test will fail for components (e.g. pop) that do not reproduce exactly
with different numbers of mpi tasks.
"""
if sharedlib_only:
SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
self.build_indv(self, sharedlib_only=sharedlib_only, model_only=model_only)
return

exeroot = self._case.get_value("EXEROOT")
Expand Down Expand Up @@ -81,7 +81,7 @@ def build(self, sharedlib_only=False, model_only=False):

# Now rebuild the system, given updated information in env_build.xml

SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
self.build_indv(self, sharedlib_only=sharedlib_only, model_only=model_only)
shutil.move("%s/%s.exe"%(exeroot,cime_model),
"%s/%s.ERP%s.exe"%(exeroot,cime_model,bld))

Expand All @@ -92,7 +92,7 @@ def build(self, sharedlib_only=False, model_only=False):
#
#

def run(self):
def run_phase(self):
# run will have values 1,2
for run in range(1,3):

Expand Down Expand Up @@ -138,16 +138,6 @@ def run(self):
self._case.set_value("CONTINUE_RUN", True)
self._case.set_value("REST_OPTION","never")
suffix = "rest"
success = SystemTestsCommon._run(self, suffix=suffix)
if not success:
break
self.run_indv(suffix=suffix)

if success:
return self._component_compare_test("base", "rest")
else:
return False



def report(self):
SystemTestsCommon.report(self)
self._component_compare_test("base", "rest")
6 changes: 3 additions & 3 deletions utils/python/CIME/SystemTests/err.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ def __init__(self, case):
"""
ERS.__init__(self, case)

def run(self):
def run_phase(self):
first_phase = self._case.get_value("RESUBMIT") == 1

if first_phase:
self._case.set_value("DOUT_S", True)
self._case.flush()
return self._ers_first_phase()
self._ers_first_phase()
else:
dout_s_root = self._case.get_value("DOUT_S_ROOT")
rundir = self._case.get_value("RUNDIR")
logger.info("staging files from archive %s" % dout_s_root)
for item in glob.glob(os.path.join(dout_s_root, "rest", "*", "*")):
shutil.copy(item, rundir)

return self._ers_second_phase()
self._ers_second_phase()
22 changes: 6 additions & 16 deletions utils/python/CIME/SystemTests/ers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _ers_first_phase(self):
expect(stop_n > 2, "ERROR: stop_n value %d too short"%stop_n)
logger.info("doing an %s %s initial test with restart file at %s %s"
%(str(stop_n), stop_option, str(rest_n), stop_option))
return SystemTestsCommon.run(self)
self.run_indv()

def _ers_second_phase(self):
stop_n = self._case.get_value("STOP_N")
Expand All @@ -47,21 +47,11 @@ def _ers_second_phase(self):
self._case.flush()
logger.info("doing an %s %s restart test"
%(str(stop_n), stop_option))
success = SystemTestsCommon._run(self, "rest")
self.run_indv(suffix="rest")

# Compare restart file
if success:
return self._component_compare_test("base", "rest")
else:
return False
self._component_compare_test("base", "rest")

def run(self):
success = self._ers_first_phase()

if success:
return self._ers_second_phase()
else:
return False

def report(self):
SystemTestsCommon.report(self)
def run_phase(self):
self._ers_first_phase()
self._ers_second_phase()
23 changes: 6 additions & 17 deletions utils/python/CIME/SystemTests/ert.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _ert_first_phase(self):
self._case.flush()

logger.info("doing a 2 month initial test with restart files at 1 month")
return SystemTestsCommon.run(self)
self.run_indv()

def _ert_second_phase(self):

Expand All @@ -40,21 +40,10 @@ def _ert_second_phase(self):
self._case.flush()

logger.info("doing an 1 month restart test with no restart files")
success = SystemTestsCommon._run(self, "rest")

self.run_indv(suffix="rest")
# Compare restart file
if success:
return self._component_compare_test("base", "rest")
else:
return False

def run(self):
success = self._ert_first_phase()

if success:
return self._ert_second_phase()
else:
return False
self._component_compare_test("base", "rest")

def report(self):
SystemTestsCommon.report(self)
def run_phase(self):
self._ert_first_phase()
self._ert_second_phase()
10 changes: 4 additions & 6 deletions utils/python/CIME/SystemTests/icp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ def __init__(self, case):
"""
SystemTestsCommon.__init__(self, case)

def build(self, sharedlib_only=False, model_only=False):
self._case.set_value("CICE_AUTO_DECOMP","false")
def build_phase(self, sharedlib_only=False, model_only=False):
self._case.set_value("CICE_AUTO_DECOMP", "false")

def run(self):
def run_phase(self):
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()
SystemTestsCommon.run(self)

def report(self):
SystemTestsCommon.report(self)
self.run_indv(self)
39 changes: 15 additions & 24 deletions utils/python/CIME/SystemTests/nck.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, case):
"""
SystemTestsCommon.__init__(self, case)

def build(self, sharedlib_only=False, model_only=False):
def build_phase(self, sharedlib_only=False, model_only=False):
'''
build can be called once (sharedlib_only and model_only both False)
or twice (once with each true)
Expand Down Expand Up @@ -62,7 +62,7 @@ def build(self, sharedlib_only=False, model_only=False):
if not sharedlib_only:
self.clean_build()

SystemTestsCommon.build(self, sharedlib_only=sharedlib_only, model_only=model_only)
self.build_indv(self, sharedlib_only=sharedlib_only, model_only=model_only)
if not model_only:
shutil.copy("env_mach_pes.xml", machpes)
if not sharedlib_only:
Expand All @@ -75,7 +75,7 @@ def build(self, sharedlib_only=False, model_only=False):
# shutil.copy("env_mach_pes.xml",
# os.path.join("LockedFiles","env_mach_pes.xml"))

def run(self):
def run_phase(self):
os.chdir(self._caseroot)

exeroot = self._case.get_value("EXEROOT")
Expand Down Expand Up @@ -106,30 +106,21 @@ def run(self):
# do an initial run test with NINST 1
#======================================================================
logger.info("default: doing a %s %s with NINST1" % (stop_n, stop_option))
success = SystemTestsCommon.run(self)
self.run_indv()

#======================================================================
# do an initial run test with NINST 2
# want to run on same pe counts per instance and same cpl pe count
#======================================================================

if success:
os.remove("%s/%s.exe" % (exeroot, cime_model))
shutil.copy("%s/%s.exe.NCK2" % (exeroot, cime_model),
"%s/%s.exe" % (exeroot, cime_model))
shutil.copy("LockedFiles/env_build.NCK2.xml", "env_build.xml")
shutil.copy("env_build.xml", "LockedFiles/env_build.xml")
shutil.copy("LockedFiles/env_mach_pes.NCK2.xml", "env_mach_pes.xml")
shutil.copy("env_mach_pes.xml", "LockedFiles/env_mach_pes.xml")

logger.info("default: doing a %s %s with NINST2" % (stop_n, stop_option))
success = SystemTestsCommon._run(self, "multiinst")

# Compare
if success:
return self._component_compare_test("base", "multiinst")
else:
return False

def report(self):
SystemTestsCommon.report(self)
os.remove("%s/%s.exe" % (exeroot, cime_model))
shutil.copy("%s/%s.exe.NCK2" % (exeroot, cime_model),
"%s/%s.exe" % (exeroot, cime_model))
shutil.copy("LockedFiles/env_build.NCK2.xml", "env_build.xml")
shutil.copy("env_build.xml", "LockedFiles/env_build.xml")
shutil.copy("LockedFiles/env_mach_pes.NCK2.xml", "env_mach_pes.xml")
shutil.copy("env_mach_pes.xml", "LockedFiles/env_mach_pes.xml")

logger.info("default: doing a %s %s with NINST2" % (stop_n, stop_option))
self.run_indv(suffix="multiinst")
self._component_compare_test("base", "multiinst")
31 changes: 12 additions & 19 deletions utils/python/CIME/SystemTests/ncr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, case):
"""
SystemTestsCommon.__init__(self, case)

def build(self, sharedlib_only=False, model_only=False):
def build_phase(self, sharedlib_only=False, model_only=False):
exeroot = self._case.get_value("EXEROOT")
cime_model = CIME.utils.get_model()

Expand Down Expand Up @@ -51,7 +51,7 @@ def build(self, sharedlib_only=False, model_only=False):

case_setup(self._case, test_mode=True, reset=True)
self.clean_build()
SystemTestsCommon.build(self, sharedlib_only, model_only)
self.build_indv(self, sharedlib_only, model_only)
shutil.move("%s/%s.exe"%(exeroot,cime_model),
"%s/%s.exe.NCR%s"%(exeroot,cime_model,bld))
shutil.copy("env_build.xml",os.path.join("LockedFiles","env_build.NCR%s.xml"%bld))
Expand All @@ -63,7 +63,7 @@ def build(self, sharedlib_only=False, model_only=False):
shutil.copy("env_mach_pes.xml",
os.path.join("LockedFiles","env_mach_pes.xml"))

def run(self):
def run_phase(self):
os.chdir(self._caseroot)

exeroot = self._case.get_value("EXEROOT")
Expand Down Expand Up @@ -94,28 +94,21 @@ def run(self):
# do an initial run test with NINST 1
#======================================================================
logger.info("default: doing a %s %s with NINST1" % (stop_n, stop_option))
success = SystemTestsCommon.run(self)
self.run_indv()

#======================================================================
# do an initial run test with NINST 2
# want to run on same pe counts per instance and same cpl pe count
#======================================================================

if success:
os.remove("%s/%s.exe" % (exeroot, cime_model))
shutil.copy("%s/%s.exe.NCR2" % (exeroot, cime_model),
"%s/%s.exe" % (exeroot, cime_model))
shutil.copy("LockedFiles/env_build.NCR2.xml", "env_build.xml")
shutil.copy("env_build.xml", "LockedFiles/env_build.xml")
os.remove("%s/%s.exe" % (exeroot, cime_model))
shutil.copy("%s/%s.exe.NCR2" % (exeroot, cime_model),
"%s/%s.exe" % (exeroot, cime_model))
shutil.copy("LockedFiles/env_build.NCR2.xml", "env_build.xml")
shutil.copy("env_build.xml", "LockedFiles/env_build.xml")

logger.info("default: doing a %s %s with NINST2" % (stop_n, stop_option))
success = SystemTestsCommon._run(self, "multiinst")
logger.info("default: doing a %s %s with NINST2" % (stop_n, stop_option))
self.run_indv(suffix="multiinst")

# Compare
if success:
return self._component_compare_test("base", "multiinst")
else:
return False

def report(self):
SystemTestsCommon.report(self)
self._component_compare_test("base", "multiinst")
Loading

0 comments on commit ba69385

Please sign in to comment.