export remote functions and reusable variables that were defined before connect was called (#292)

This commit is contained in:
Robert Nishihara
2016-07-26 11:40:09 -07:00
committed by Philipp Moritz
parent 8e9f98c5ff
commit 3bae6f136b
15 changed files with 167 additions and 141 deletions
+11 -5
View File
@@ -11,8 +11,9 @@ import ray.array.distributed as da
class RemoteArrayTest(unittest.TestCase):
def testMethods(self):
worker_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_worker.py")
ray.services.start_ray_local(num_workers=1, worker_path=worker_path)
for module in [ra.core, ra.random, ra.linalg, da.core, da.random, da.linalg]:
reload(module)
ray.services.start_ray_local(num_workers=1)
# test eye
ref = ra.eye(3)
@@ -44,6 +45,8 @@ class RemoteArrayTest(unittest.TestCase):
class DistributedArrayTest(unittest.TestCase):
def testSerialization(self):
for module in [ra.core, ra.random, ra.linalg, da.core, da.random, da.linalg]:
reload(module)
ray.services.start_ray_local()
x = da.DistArray()
@@ -56,8 +59,9 @@ class DistributedArrayTest(unittest.TestCase):
ray.services.cleanup()
def testAssemble(self):
worker_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_worker.py")
ray.services.start_ray_local(num_workers=1, worker_path=worker_path)
for module in [ra.core, ra.random, ra.linalg, da.core, da.random, da.linalg]:
reload(module)
ray.services.start_ray_local(num_workers=1)
a = ra.ones([da.BLOCK_SIZE, da.BLOCK_SIZE])
b = ra.zeros([da.BLOCK_SIZE, da.BLOCK_SIZE])
@@ -68,7 +72,9 @@ class DistributedArrayTest(unittest.TestCase):
ray.services.cleanup()
def testMethods(self):
worker_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_worker.py")
for module in [ra.core, ra.random, ra.linalg, da.core, da.random, da.linalg]:
reload(module)
worker_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../scripts/default_worker.py")
ray.services.start_services_local(num_objstores=2, num_workers_per_objstore=5, worker_path=worker_path)
x = da.zeros([9, 25, 51], "float")