From 047e72a509c2f5ecfdc7481283fa7425a0cf541a Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Mon, 26 Feb 2024 10:51:31 -0800 Subject: [PATCH 1/3] Exit on launch error --- wlutil/launch.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wlutil/launch.py b/wlutil/launch.py index 406363ab..ac321328 100644 --- a/wlutil/launch.py +++ b/wlutil/launch.py @@ -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: @@ -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 not 'COMMAND_EXIT_CODE="0"' 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 From 2a23a7bba965c485f86bdfd85125b214d7fdf74f Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Mon, 26 Feb 2024 13:09:18 -0800 Subject: [PATCH 2/3] Fix typo --- wlutil/launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wlutil/launch.py b/wlutil/launch.py index ac321328..7855218f 100644 --- a/wlutil/launch.py +++ b/wlutil/launch.py @@ -126,7 +126,7 @@ def launchWorkload(baseConfig, jobs=None, spike=False, silent=False): if config['launch']: runResDir = baseResDir / config['name'] uartLog = runResDir / "uartlog" - uartlogs.append(uartlog) + uartlogs.append(uartLog) os.makedirs(runResDir) if spike: From 95cf53a6f5bf800fcbb2fab2061f9b27df74d5dd Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Tue, 27 Feb 2024 09:28:35 -0800 Subject: [PATCH 3/3] Fix formatting --- wlutil/launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wlutil/launch.py b/wlutil/launch.py index 7855218f..a99d0902 100644 --- a/wlutil/launch.py +++ b/wlutil/launch.py @@ -162,7 +162,7 @@ def launchWorkload(baseConfig, jobs=None, spike=False, silent=False): try: with open(uartlog, 'r') as f: last_line = f.readlines()[-1] - if not 'COMMAND_EXIT_CODE="0"' in last_line: + 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.")