Skip to content

Commit

Permalink
Merge pull request #1240 from ESMCI/jgfouca/fixes_to_submit_phase_pr
Browse files Browse the repository at this point in the history
Couple fixes to recent PR that added SUBMIT phase.
Cannot allow resubmit to lose RUN phase info of previous run.

Test suite: by-hand
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes [CIME Github issue #]

User interface changes?: None

Code review: @jedwards4b
  • Loading branch information
jedwards4b authored Mar 14, 2017
2 parents be3e675 + 9246239 commit fecaaad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/lib/CIME/case_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ def submit(case, job=None, resubmit=False, no_batch=False, batch_args=None):
casebaseid = case.get_value("CASEBASEID")
# This should take care of the race condition where the submitted job
# begins immediately and tries to set RUN phase. We proactively assume
# a passed SUBMIT phase.
# a passed SUBMIT phase. If this state is already PASS, don't set it again
# because then we'll lose RUN phase info if it's there. This info is important
# for system_tests_common to know if it needs to reinitialize the test or not.
with TestStatus(test_dir=caseroot, test_name=casebaseid) as ts:
ts.set_status(SUBMIT_PHASE, TEST_PASS_STATUS)
phase_status = ts.get_status(SUBMIT_PHASE)
if phase_status != TEST_PASS_STATUS:
ts.set_status(SUBMIT_PHASE, TEST_PASS_STATUS)

try:
functor = lambda: _submit(case, job, resubmit, no_batch, batch_args)
Expand Down
2 changes: 2 additions & 0 deletions scripts/lib/CIME/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,8 @@ def _setup_cs_files(self):
template = template.replace("<PATH>",
os.path.join(self._cime_root,"scripts","Tools")).replace\
("<TESTID>", self._test_id)
if not os.path.exists(self._test_root):
os.makedirs(self._test_root)
cs_status_file = os.path.join(self._test_root, "cs.status.%s" % self._test_id)
with open(cs_status_file, "w") as fd:
fd.write(template)
Expand Down

0 comments on commit fecaaad

Please sign in to comment.