Add a line about socket hopefully will avoid port conflicts
This commit is contained in:
parent
0d41bdae26
commit
b54fc4ba3a
@ -398,6 +398,7 @@ def dist_init(rank, args):
|
|||||||
addr = socket.gethostname()
|
addr = socket.gethostname()
|
||||||
|
|
||||||
with socket.socket() as s:
|
with socket.socket() as s:
|
||||||
|
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
s.bind((addr, 0))
|
s.bind((addr, 0))
|
||||||
_, port = s.getsockname()
|
_, port = s.getsockname()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user