Skip to content

Commit

Permalink
Clear out old commands if none specified. Also fix output issue when
Browse files Browse the repository at this point in the history
launch fails.
  • Loading branch information
Nathan Pemberton committed Dec 29, 2018
1 parent 964cd37 commit c31926c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wlutil/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ def applyBase(self, baseCfg):
if 'launch' not in self.cfg:
self.cfg['launch'] = True

if 'runSpec' not in self.cfg:
self.cfg['run'] = os.path.join(wlutil_dir, 'null_run.sh')
self.cfg['runSpec'] = RunSpec(self.cfg)

# The following methods are needed by MutableMapping
def __getitem__(self, key):
return self.cfg[key]
Expand Down
1 change: 1 addition & 0 deletions wlutil/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def launchWorkload(cfgName, cfgs, job='all', spike=False):
try:
run(config['post_run_hook'] + " " + baseResDir, cwd=config['workdir'], shell=True)
except sp.CalledProcessError as e:
log.info("\nRun output available in: " + os.path.dirname(runResDir))
raise RuntimeError("Post run hook failed:\n" + e.output)

log.info("\nRun output available in: " + os.path.dirname(runResDir))
Expand Down
3 changes: 3 additions & 0 deletions wlutil/null_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# This script does nothing, it's used to disable previously specified run scripts or commands
exit 0

0 comments on commit c31926c

Please sign in to comment.