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:
mehrdadnandMehrdad authored and GitHub committed 2020-06-08 21:29:46 -07:00
1 parent d2ef29f0d2
commit f93bb008bb
15 files changed
+31 -27

No files matched your search

+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)]))