Skip to content

Commit

Permalink
Merge pull request #1316 from ESMCI/jgfouca/handle_titan_batch_errs
Browse files Browse the repository at this point in the history
Better handling of poorly implemented batch systems

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

Fixes #1270

User interface changes?: None

Code review: @rljacob @jedwards4b
  • Loading branch information
jgfouca authored Apr 7, 2017
2 parents 2b4f7fe + dfb5623 commit 7fb258b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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 @@ -384,7 +384,7 @@ def submit_single_job(self, case, job, depid=None, no_batch=False, batch_args=No
submitcmd += string + " "

logger.info("Submitting job script %s"%submitcmd)
output = run_cmd_no_fail(submitcmd)
output = run_cmd_no_fail(submitcmd + " 2>&1")
jobid = self.get_job_id(output)
logger.info("Submitted job id is %s"%jobid)
return jobid
Expand Down
8 changes: 6 additions & 2 deletions scripts/lib/CIME/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,12 @@ def run_cmd_no_fail(cmd, input_str=None, from_dir=None, verbose=None,
'foo'
"""
stat, output, errput = run_cmd(cmd, input_str, from_dir, verbose, arg_stdout, arg_stderr)
expect(stat == 0, "Command: '%s' failed with error '%s'%s" %
(cmd, errput, "" if from_dir is None else " from dir '%s'" % from_dir))
if stat != 0:
# If command produced no errput, put output in the exception since we
# have nothing else to go on.
errput = output if errput == "" else errput
expect(False, "Command: '%s' failed with error '%s'%s" %
(cmd, errput, "" if from_dir is None else " from dir '%s'" % from_dir))
return output

def check_minimum_python_version(major, minor):
Expand Down

0 comments on commit 7fb258b

Please sign in to comment.