Permalink
Browse files

add all completed task IDs to Scheduler.all_done

  • Loading branch information...
1 parent b78cec8 commit 168e61b2f84c240640f8556b6bea4572c8d47f1d @minrk minrk committed Oct 28, 2010
Showing with 8 additions and 11 deletions.
  1. +4 −8 IPython/zmq/parallel/dependency.py
  2. +4 −3 IPython/zmq/parallel/scheduler.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."""
@@ -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)

0 comments on commit 168e61b

Please sign in to comment.