Skip to content

Commit

Permalink
sta working now
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 19, 2016
1 parent 77b4ae1 commit acb6008
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
8 changes: 6 additions & 2 deletions utils/python/CIME/SystemTests/system_tests_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,12 @@ def _check_for_memleak(self, cpllog):
originaldate = int(memlist[0][0])
finalmem = float(memlist[-1][1])
originalmem = float(memlist[0][1])
memdiff = (finalmem - originalmem)/originalmem
if memdiff < 0.1:
memdiff = -1
if originalmem > 0:
memdiff = (finalmem - originalmem)/originalmem
if memdiff < 0:
append_status("COMMENT: insuffiencient data for memleak test",sfile="TestStatus")
elif memdiff < 0.1:
append_status("PASS %s memleak"%(self._case.get_value("CASEBASEID")),
sfile="TestStatus")
else:
Expand Down
11 changes: 8 additions & 3 deletions utils/python/CIME/XML/env_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def get_submit_args(self, case, job):
name = arg.get("name")
if self.batchtype == "cobalt" and job == "case.st_archive":
if flag == "-n":
name = 1
name = 'task_count'
if flag == "--mode":
continue

Expand Down Expand Up @@ -431,9 +431,14 @@ def submit_single_job(self, case, job, depid=None, no_batch=False):
for string in (batchsubmit, submitargs, batchredirect, job):
if string is not None:
submitcmd += string + " "

if case.get_value("MACH") == "mira":
if job in ("case.test", "case.run"):
if os.path.isfile(".original_host"):
with open(".original_host", "r") as fd:
sshhost = fd.read()
submitcmd = "ssh %s `%s`"%(sshhost, submitcmd)

if self.batchtype == "pbs":
submitcmd += " -F \"--caseroot %s\""%caseroot

logger.info("Submitting job script %s"%submitcmd)
output = run_cmd(submitcmd)
Expand Down
8 changes: 5 additions & 3 deletions utils/python/CIME/case_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,12 @@ def resubmit_check(case):
# Note that Mira requires special logic

dout_s = case.get_value("DOUT_S")
logger.warn("dout_s %s "%(dout_s))
mach = case.get_value("MACH")
logger.warn("mach %s "%(mach))
testcase = case.get_value("TESTCASE")
resubmit_num = case.get_value("RESUBMIT")
logger.warn("dout_s %s, mach %s resubmit_num "%(dout_s, mach, resubmit_num))
logger.warn("resubmit_num %s"%(resubmit_num))
# If dout_s is True than short-term archiving handles the resubmit
# If dout_s is True and machine is mira submit the st_archive script
resubmit = False
Expand All @@ -369,8 +371,7 @@ def resubmit_check(case):
elif dout_s and mach == 'mira':
caseroot = case.get_value("CASEROOT")
cimeroot = case.get_value("CIMEROOT")
cmd = "ssh cooleylogin1 'cd %s; CIMEROOT=%s ./case.submit %s case.st_archive "%(caseroot, cimeroot, caseroot)

cmd = "ssh cooleylogin1 'cd %s; CIMEROOT=%s ./case.submit %s --job case.st_archive' "%(caseroot, cimeroot, caseroot)
run_cmd(cmd, verbose=True)

if resubmit:
Expand Down Expand Up @@ -418,6 +419,7 @@ def case_run(case):
if data_assimilation:
do_data_assimilation(case, data_assimilation_script, lid)

logger.warn("check for resubmit")
resubmit_check(case)

return True
6 changes: 5 additions & 1 deletion utils/python/CIME/case_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if there is no queueing system. A cesm workflow may include multiple
jobs.
"""

import socket
from CIME.XML.standard_module_setup import *
from CIME.case import Case
from CIME.utils import expect
Expand Down Expand Up @@ -35,6 +35,9 @@ def submit(case, job=None, resubmit=False, no_batch=False, prereq_jobid=None):
if job in ("case.test","case.run"):
check_case(case, caseroot)
check_DA_settings(case)
if case.get_value("MACH") == "mira":
with open(".original_host","w") as fd:
fd.write( socket.gethostname())

cimeroot = case.get_value("CIMEROOT")
os.environ["CIMEROOT"] = cimeroot
Expand Down Expand Up @@ -66,6 +69,7 @@ def submit(case, job=None, resubmit=False, no_batch=False, prereq_jobid=None):

case.set_value("RUN_WITH_SUBMIT",True)
case.flush()

logger.warn("submit_jobs %s"%job)
case.submit_jobs(no_batch=no_batch, job=job)

Expand Down
4 changes: 2 additions & 2 deletions utils/python/CIME/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def expect(condition, error_msg, exc_type=SystemExit):
"""
if (not condition):
# Uncomment these to bring up a debugger when an expect fails
#import pdb
#pdb.set_trace()
import pdb
pdb.set_trace()
raise exc_type("ERROR: %s" % error_msg)

# Should only be called from get_cime_config()
Expand Down

0 comments on commit acb6008

Please sign in to comment.