Skip to content

Commit

Permalink
fix popen error (PaddlePaddle#24767)
Browse files Browse the repository at this point in the history
replace join to terminate
  • Loading branch information
mapingshuo authored May 28, 2020
1 parent 8bbb829 commit 9388a63
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python/paddle/distributed/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9388a63

Please sign in to comment.