chore: propagate horovod worker process retcode
The change propagates the horovod worker process's retcode through the worker process wrapper that is responsible for redirecting its stdout/stderr and starting it so, to horovod, it is still as if it ran the worker process directly.
@@ -25,7 +25,7 @@ def run_all(ts: List[threading.Thread]) -> None:
t.join()
-def main() -> None:
+def main() -> int:
rank = os.environ.get("HOROVOD_RANK")
proc = subprocess.Popen(
[
@@ -47,6 +47,8 @@ def main() -> None:
]
)
+ return proc.returncode
+
if __name__ == "__main__":
- main()
+ sys.exit(main())
