def uimap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) def submit(*argz): """send a job to the server""" _pool = self._serve() #print("using %s local workers" % _pool.get_ncpus()) try: return _pool.submit(f, argz, globals=globals()) except pp.DestroyedServerError: self._is_alive(None) def imap_unordered(it): """build a unordered map iterator""" it = list(it) while len(it): for i, job in enumerate(it): if job.finished: yield it.pop(i)() break # yield it.pop(0).get() # wait for the first element? # *subprocess* # alternately, loop in a subprocess return #raise StopIteration # submit all jobs, then collect results as they become available return imap_unordered(builtins.map(submit, *args))
def imap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) def submit(*argz): """send a job to the server""" #print "using", __STATE['server'].get_ncpus(), 'local workers' return __STATE['server'].submit(f, argz, globals=globals()) # submit all jobs, then collect results as they become available return (subproc() for subproc in __builtin__.map(submit, *args))
def imap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) def submit(*argz): """send a job to the server""" _pool = self._serve() #print "using", _pool.get_ncpus(), 'local workers' return _pool.submit(f, argz, globals=globals()) # submit all jobs, then collect results as they become available return (subproc() for subproc in __builtin__.map(submit, *args))
def imap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) def submit(*argz): """send a job to the server""" _pool = self._serve() #print "using", _pool.get_ncpus(), 'local workers' try: return _pool.submit(f, argz, globals=globals()) except pp.DestroyedServerError: self._is_alive(None) # submit all jobs, then collect results as they become available return (subproc() for subproc in __builtin__.map(submit, *args))
def imap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) def submit(*argz): """send a job to the server""" _pool = self._serve() #print("using %s local workers" % _pool.get_ncpus()) try: return _pool.submit(f, argz, globals=globals()) except pp.DestroyedServerError: self._is_alive(None) # submit all jobs, then collect results as they become available return (subproc() for subproc in list(builtins.map(submit, *args)))
def uimap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) def submit(*argz): """send a job to the server""" _pool = self._serve() #print "using", _pool.get_ncpus(), 'local workers' try: return _pool.submit(f, argz, globals=globals()) except pp.DestroyedServerError: self._is_alive(None) def imap_unordered(it): """build a unordered map iterator""" while len(it): for i,job in enumerate(it): if job.finished: yield it.pop(i)() break # yield it.pop(0).get() # wait for the first element? # *subprocess* # alternately, loop in a subprocess raise StopIteration # submit all jobs, then collect results as they become available return imap_unordered(__builtin__.map(submit, *args))
def uimap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) _pool = self._serve() return _pool.imap_unordered(star(f), zip(*args)) # chunksize
def uimap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) _pool = self._serve() return _pool.imap_unordered(star(f), zip(*args)) # chunksize
def uimap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) return __STATE['threads'].imap_unordered(star(f), zip(*args)) # chunksize
def imap(self, f, *args, **kwds): AbstractWorkerPool._AbstractWorkerPool__imap(self, f, *args, **kwds) return __STATE['pool'].imap(star(f), zip(*args)) # chunksize