From efb61ca9c71d09282e7dfbea15a0a92ad5fe5e1d Mon Sep 17 00:00:00 2001 From: Richard Shin Date: Sat, 3 Sep 2016 18:25:47 -0700 Subject: [PATCH] Return scheduler address in ray.init (#403) --- lib/python/ray/worker.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/python/ray/worker.py b/lib/python/ray/worker.py index 934429044..7037bcb6f 100644 --- a/lib/python/ray/worker.py +++ b/lib/python/ray/worker.py @@ -609,9 +609,12 @@ def init(start_ray_local=False, num_workers=None, num_objstores=None, scheduler_ driver_mode (Optional[bool]): The mode in which to start the driver. This should be one of SCRIPT_MODE, PYTHON_MODE, and SILENT_MODE. - raises: - Exception: An exception is raised if an inappropriate combination of - arguments is passed in. + Returns: + A string containing the address of the scheduler. + + Raises: + Exception: An exception is raised if an inappropriate combination of + arguments is passed in. """ # Make GRPC only print error messages. os.environ["GRPC_VERBOSITY"] = "ERROR" @@ -643,6 +646,7 @@ def init(start_ray_local=False, num_workers=None, num_objstores=None, scheduler_ # to disconnect will happen in the call to cleanup() when the Python script # exits. connect(node_ip_address, scheduler_address, worker=global_worker, mode=driver_mode) + return scheduler_address def cleanup(worker=global_worker): """Disconnect the driver, and terminate any processes started in init.