Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit on 'launch' job error(s) #296

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions wlutil/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ def launchWorkload(baseConfig, jobs=None, spike=False, silent=False):
baseResDir = wlutil.getOpt('res-dir') / wlutil.getOpt('run-name')

screenIdentifiers = {}
uartlogs = []

try:
for config in configs:
if config['launch']:
runResDir = baseResDir / config['name']
uartLog = runResDir / "uartlog"
uartlogs.append(uartLog)
os.makedirs(runResDir)

if spike:
Expand Down Expand Up @@ -156,6 +158,15 @@ def launchWorkload(baseConfig, jobs=None, spike=False, silent=False):
for proc in jobProcs:
proc.wait()

for uartlog in uartlogs:
try:
with open(uartlog, 'r') as f:
last_line = f.readlines()[-1]
if 'COMMAND_EXIT_CODE="0"' not in last_line:
raise RuntimeError("One (or more) job(s) returned a non-zero error code. Please check output.")
except FileNotFoundError:
raise RuntimeError(f"Unable to check output of job with {uartlog} uartlog.")

except Exception:
cleanUpSubProcesses()
raise
Expand Down
Loading