From 556be6d73bdcaebdfd4020d95947d2f82c246b95 Mon Sep 17 00:00:00 2001 From: mapingshuo Date: Tue, 30 Jun 2020 09:45:10 +0800 Subject: [PATCH] fix popen error (#24767) (#25215) replace join to terminate, test=develop --- python/paddle/distributed/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/python/paddle/distributed/utils.py b/python/paddle/distributed/utils.py index 3b55ec7ffc..511d501a22 100644 --- a/python/paddle/distributed/utils.py +++ b/python/paddle/distributed/utils.py @@ -252,15 +252,12 @@ def get_cluster(node_ips, node_ip, paddle_ports, selected_gpus): def terminate_local_procs(procs): for p in procs: if p.proc.poll() is None: - # subprocess need to release resource(e.g. shared memory) - # use join to wait subprocess releasing - p.proc.join(timeout=1) + p.proc.terminate() p.log_fn.close() logger.debug("terminate process id:{}".format(p.proc.pid)) - # wait all process terminiated - # time.sleep(3) - + #wait all process terminiated + time.sleep(3) for step in range(0, 50): alive = False for p in procs: -- GitLab