Change os.uname()[1] and socket.gethostname() to the portable and faster platform.node_ip() (#8839)

Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
mehrdadn
2020-06-08 21:29:46 -07:00
committed by GitHub
co-authored by Mehrdad
parent d2ef29f0d2
commit f93bb008bb
15 changed files with 31 additions and 27 deletions
+2 -2
View File
@@ -211,7 +211,7 @@ program:
.. code-block:: python
from collections import Counter
import socket
import platform
import time
import ray
@@ -220,7 +220,7 @@ program:
@ray.remote
def f(x):
time.sleep(0.01)
return x + (socket.gethostname(), )
return x + (platform.node(), )
# Check that objects can be transferred from each node to each other node.
%time Counter(ray.get([f.remote(f.remote(())) for _ in range(100)]))