0

Running with -p should be OK now

This commit is contained in:
Andrew Chin
2011-02-24 23:06:36 -05:00
parent 38d970f7e1
commit 6f060633ad

View File

@@ -367,22 +367,23 @@ class WorldRenderer(object):
logging.debug("Rendering chunks in {0} processes".format(processes)) logging.debug("Rendering chunks in {0} processes".format(processes))
pool = multiprocessing.Pool(processes=processes) pool = multiprocessing.Pool(processes=processes)
asyncresults = [] asyncresults = []
for col, row, chunkfile in chunks: for col, row, chunkXY in chunks:
if inclusion_set and (col, row) not in inclusion_set: ##TODO/if inclusion_set and (col, row) not in inclusion_set:
# Skip rendering, just find where the existing image is ##TODO/ # Skip rendering, just find where the existing image is
_, imgpath = chunk.find_oldimage(chunkfile, cached, self.caves) ##TODO/ _, imgpath = chunk.find_oldimage(chunkfile, cached, self.caves)
if imgpath: ##TODO/ if imgpath:
results[(col, row)] = imgpath ##TODO/ results[(col, row)] = imgpath
continue ##TODO/ continue
oldimg = chunk.find_oldimage(chunkfile, cached, self.caves) oldimg = chunk.find_oldimage(chunkXY, cached, self.caves)
if chunk.check_cache(chunkfile, oldimg): if oldimg[1]: ## TODO chunk.check_cache(chunkfile, oldimg):
result = FakeAsyncResult(oldimg[1]) result = FakeAsyncResult(oldimg[1])
else: else:
result = pool.apply_async(chunk.render_and_save, result = pool.apply_async(chunk.render_and_save,
args=(chunkfile,self.cachedir,self, oldimg), args=(chunkXY,self.cachedir,self, oldimg),
kwds=dict(cave=self.caves, queue=q)) kwds=dict(cave=self.caves, queue=q))
asyncresults.append((col, row, result)) if result:
asyncresults.append((col, row, result))
pool.close() pool.close()