From 3ac729350b3e1a5af74826c01eb8cc5e8274a2d5 Mon Sep 17 00:00:00 2001 From: clemente0420 <32806348+clemente0420@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:04:13 +0800 Subject: [PATCH] Update start_pytorch_task.py - Handle non-zero return code in process execution feat: Handle non-zero return code in process execution Refactor the code to check the return code of each process execution. If the return code is non-zero, an exception is raised with a descriptive error message indicating the process ID and suggesting to check the relevant issue for further details. --- training/run_benchmarks/pytorch/start_pytorch_task.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/training/run_benchmarks/pytorch/start_pytorch_task.py b/training/run_benchmarks/pytorch/start_pytorch_task.py index 973fe0bf6..a7abd0c74 100644 --- a/training/run_benchmarks/pytorch/start_pytorch_task.py +++ b/training/run_benchmarks/pytorch/start_pytorch_task.py @@ -194,6 +194,9 @@ def main(): proc.wait() START_LOGGER.stop() + # check the return code of each process + if proc.returncode != 0: + raise Exception("Exception! process {0} returncode != 0, please check relevant issue".format(str(proc.pid))) if __name__ == '__main__':