Skip to content

Commit

Permalink
Fixed Some Issues which Reappeared
Browse files Browse the repository at this point in the history
After a rebase from master a few issues reappeared. Most issues were
typos or wrong function handle used. I have fixed these issues.

Test suite: scripts_regression_tests.py
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes #1276

User interface changes?: Added skip-preview-namelist option

Code review: @rljacob, @jgfouca
  • Loading branch information
Erich L Foster committed May 9, 2017
1 parent c92cc9a commit 668be81
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
30 changes: 20 additions & 10 deletions scripts/Tools/case.submit
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ from CIME.case import Case
###############################################################################
def parse_command_line(args, description):
###############################################################################
parser = argparse.ArgumentParser(description=description)
parser = argparse.ArgumentParser(
usage="""\n{0} [<casedir>] [--verbose]
OR
{0} --help
OR
{0} --test
\033[1mEXAMPLES:\033[0m
\033[1;32m# Setup case \033[0m
> {0}
""".format(os.path.basename(args[0], )),
description=description,
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)

CIME.utils.setup_standard_logging_options(parser)

Expand Down Expand Up @@ -45,22 +57,20 @@ def parse_command_line(args, description):

CIME.utils.expect(args.prereq is None, "--prereq not currently supported")

CIME.utils.handle_standard_logging_options(args)

return args
return args.test, args.caseroot, args.job, args.no_batch, args.resubmit, args.skip_preview_namelist, args.batch_args

###############################################################################
def _main_func(description):
###############################################################################
args = parse_command_line(sys.argv, description)
if args.test:
test, caseroot, job, no_batch, resubmit, skip_pnl, batch_args = parse_command_line(sys.argv, description)
if test:
test_results = doctest.testmod(verbose=True)
sys.exit(1 if test_results.failed > 0 else 0)

with Case(args.caseroot, read_only=False) as case:
submit(case, job=args.job, no_batch=args.no_batch,
resubmit=args.resubmit, skip_pnl=args.skip_preview_namelist,
batch_args=args.batch_args)
with Case(caseroot, read_only=False) as case:
submit(case, job=job, no_batch=no_batch,
resubmit=resubmit, skip_pnl=skip_pnl,
batch_args=batch_args)

if __name__ == "__main__":
_main_func(__doc__)
2 changes: 1 addition & 1 deletion scripts/lib/CIME/XML/env_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def submit_jobs(self, case, no_batch=False, job=None, skip_pnl=False, batch_args
jobid = None

logger.warn("job is {}".format(job))
result = self._submit_single_job(case, job, jobid, no_batch=no_batch, skip_pn=skip_pnl, batch_args=batch_args, dry_run=dry_run)
result = self._submit_single_job(case, job, jobid, no_batch=no_batch, skip_pnl=skip_pnl, batch_args=batch_args, dry_run=dry_run)
batch_job_id = str(alljobs.index(job)) if dry_run else result
depid[job] = batch_job_id
jobcmds.append( (job, result) )
Expand Down

0 comments on commit 668be81

Please sign in to comment.