Example #1
0
 def test1(self):
     from swamp.partitioner import PlainPartitioner
     import cPickle as pickle
     cmds = pickle.load(open('last.pypickle'))
     #b = Bipartitioner(cmds)
     b = PlainPartitioner(cmds)
     
     print b.result()
Example #2
0
    def dispatchAll(self, cmdList, hook=lambda f:None):
        self.resultEvent.clear()
        self.gradHook = hook
        self.targetCount += len(cmdList)
        # Break things into clusters:
        p = PlainPartitioner(cmdList)
        self.clusters = p.result()
        
        # Then put ready clusters in queues for each executor.
        self.rootClusters = iter(self.clusters[0])
        self.polledExecutor = itertools.cycle(self.executors)
        
        self._dispatchRoots()
        
        # remaining scheduling and dispatching will run as
        # asynchronously-initiated callbacks.

        # caller expects us to block until finish, so let's block.
        self.resultEvent.wait()
        return