Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add all completed task IDs to Scheduler.all_done

  • Loading branch information...
commit 168e61b2f84c240640f8556b6bea4572c8d47f1d 1 parent b78cec8
@minrk minrk authored
View
12 IPython/zmq/parallel/dependency.py
@@ -80,15 +80,11 @@ def check(self, completed):
if len(self) == 0:
return True
if self.mode == 'all':
- for dep in self:
- if dep not in completed:
- return False
- return True
+ return self.issubset(completed)
elif self.mode == 'any':
- for com in completed:
- if com in self.dependencies:
- return True
- return False
+ return not self.isdisjoint(completed)
+ else:
+ raise NotImplementedError("Only any|all supported, not %r"%mode)
def as_dict(self):
"""Represent this dependency as a dict. For json compatibility."""
View
7 IPython/zmq/parallel/scheduler.py
@@ -30,9 +30,9 @@
@decorator
def logged(f,self,*args,**kwargs):
- # print ("#--------------------")
- # print ("%s(*%s,**%s)"%(f.func_name, args, kwargs))
- # print ("#--")
+ print ("#--------------------")
+ print ("%s(*%s,**%s)"%(f.func_name, args, kwargs))
+ print ("#--")
return f(self,*args, **kwargs)
#----------------------------------------------------------------------
@@ -340,6 +340,7 @@ def handle_result_success(self, idents, parent, raw_msg):
msg_id = parent['msg_id']
self.pending[engine].pop(msg_id)
self.completed[engine].add(msg_id)
+ self.all_done.add(msg_id)
self.update_dependencies(msg_id)
Please sign in to comment.
Something went wrong with that request. Please try again.