Skip to content

Commit

Permalink
remove recursive option from register_module (ray-project#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertnishihara authored and pcmoritz committed Jul 8, 2016
1 parent 7ff1580 commit 82ab6d6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/python/ray/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,19 @@ def task_info(worker=global_worker):
"""Tell the scheduler to return task information. Currently includes a list of all failed tasks since the start of the cluster."""
return ray.lib.task_info(worker.handle);

def register_module(module, recursive=False, worker=global_worker):
def register_module(module, worker=global_worker):
"""
This registers each remote function in the module with the scheduler, so tasks
with those functions can be scheduled on this worker.
:param module: The module of functions to register.
"""
logging.info("registering functions in module {}.".format(module.__name__))
for name in dir(module):
val = getattr(module, name)
if hasattr(val, "is_remote") and val.is_remote:
logging.info("registering {}.".format(val.func_name))
worker.register_function(val)
# elif recursive and isinstance(val, ModuleType):
# register_module(val, recursive, worker)

def connect(scheduler_address, objstore_address, worker_address, is_driver=False, worker=global_worker, mode=ray.WORKER_MODE):
if hasattr(worker, "handle"):
Expand Down

0 comments on commit 82ab6d6

Please sign in to comment.