>>> @ray.remote ... def f2(): ... time.sleep(1) ... --------------------------------------------------------------------------- IOError Traceback (most recent call last) in () /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in remote(*args, **kwargs) 2402 num_return_vals, num_cpus, 2403 num_gpus, num_custom_resource, -> 2404 max_calls, checkpoint_interval)(args[0]) 2405 else: 2406 # This is the case where the decorator is something like /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in remote_decorator(func_or_class) 2312 max_calls=max_calls) 2313 return remote_function_decorator(func_or_class, -> 2314 function_properties) 2315 if inspect.isclass(func_or_class): 2316 return worker.make_actor(func_or_class, num_cpus, num_gpus, /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in remote_function_decorator(func, function_properties) 2322 func_name = "{}.{}".format(func.__module__, func.__name__) 2323 if func_id is None: -> 2324 function_id = compute_function_id(func_name, func) 2325 else: 2326 function_id = func_id /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in compute_function_id(func_name, func) 2273 import __main__ as main 2274 if hasattr(main, "__file__") or in_ipython(): -> 2275 function_id_hash.update(inspect.getsource(func).encode("ascii")) 2276 # Compute the function ID. 2277 function_id = function_id_hash.digest() /root/anaconda2/lib/python2.7/inspect.pyc in getsource(object) 698 or code object. The source code is returned as a single string. An 699 IOError is raised if the source code cannot be retrieved.""" --> 700 lines, lnum = getsourcelines(object) 701 return string.join(lines, '') 702 /root/anaconda2/lib/python2.7/inspect.pyc in getsourcelines(object) 687 original source file the first line of code was found. An IOError is 688 raised if the source code cannot be retrieved.""" --> 689 lines, lnum = findsource(object) 690 691 if ismodule(object): return lines, 0 /root/anaconda2/lib/python2.7/inspect.pyc in findsource(object) 535 lines = linecache.getlines(file) 536 if not lines: --> 537 raise IOError('could not get source code') 538 539 if ismodule(object): IOError: could not get source code >>> def f2(): ... time.sleep(1) ... >>> f2 = ray.remote(f2) --------------------------------------------------------------------------- IOError Traceback (most recent call last) in () /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in remote(*args, **kwargs) 2402 num_return_vals, num_cpus, 2403 num_gpus, num_custom_resource, -> 2404 max_calls, checkpoint_interval)(args[0]) 2405 else: 2406 # This is the case where the decorator is something like /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in remote_decorator(func_or_class) 2312 max_calls=max_calls) 2313 return remote_function_decorator(func_or_class, -> 2314 function_properties) 2315 if inspect.isclass(func_or_class): 2316 return worker.make_actor(func_or_class, num_cpus, num_gpus, /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in remote_function_decorator(func, function_properties) 2322 func_name = "{}.{}".format(func.__module__, func.__name__) 2323 if func_id is None: -> 2324 function_id = compute_function_id(func_name, func) 2325 else: 2326 function_id = func_id /root/anaconda2/lib/python2.7/site-packages/ray-0.2.1-py2.7-linux-i686.egg/ray/worker.pyc in compute_function_id(func_name, func) 2273 import __main__ as main 2274 if hasattr(main, "__file__") or in_ipython(): -> 2275 function_id_hash.update(inspect.getsource(func).encode("ascii")) 2276 # Compute the function ID. 2277 function_id = function_id_hash.digest() /root/anaconda2/lib/python2.7/inspect.pyc in getsource(object) 698 or code object. The source code is returned as a single string. An 699 IOError is raised if the source code cannot be retrieved.""" --> 700 lines, lnum = getsourcelines(object) 701 return string.join(lines, '') 702 /root/anaconda2/lib/python2.7/inspect.pyc in getsourcelines(object) 687 original source file the first line of code was found. An IOError is 688 raised if the source code cannot be retrieved.""" --> 689 lines, lnum = findsource(object) 690 691 if ismodule(object): return lines, 0 /root/anaconda2/lib/python2.7/inspect.pyc in findsource(object) 535 lines = linecache.getlines(file) 536 if not lines: --> 537 raise IOError('could not get source code') 538 539 if ismodule(object): IOError: could not get source code