示例#1
0
文件: statistics.py 项目: nco/swamp
 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()
示例#2
0
文件: scheduler.py 项目: nco/swamp
    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