chunk progress prints fewer lines. Made a perhaps insignificant
algorithm change
This commit is contained in:
4
gmap.py
4
gmap.py
@@ -40,7 +40,9 @@ def main():
|
|||||||
if options.procs > 1:
|
if options.procs > 1:
|
||||||
for i, (col, row, filename) in enumerate(chunks):
|
for i, (col, row, filename) in enumerate(chunks):
|
||||||
results[col, row].wait()
|
results[col, row].wait()
|
||||||
print "{0}/{1} chunks rendered".format(i, len(chunks))
|
if i > 0:
|
||||||
|
if 1000 % i == 0 or i % 1000 == 0:
|
||||||
|
print "{0}/{1} chunks rendered".format(i, len(chunks))
|
||||||
|
|
||||||
print "Writing out html file"
|
print "Writing out html file"
|
||||||
if not os.path.exists(destdir):
|
if not os.path.exists(destdir):
|
||||||
|
|||||||
7
world.py
7
world.py
@@ -513,7 +513,6 @@ def quadtree_recurse(chunkmap, colstart, colend, rowstart, rowend, prefix, quadr
|
|||||||
quad0result = Procobj(sem, target=quadtree_recurse,
|
quad0result = Procobj(sem, target=quadtree_recurse,
|
||||||
args=(chunkmap, colstart, colmid, rowstart, rowmid, newprefix, "0", sem)
|
args=(chunkmap, colstart, colmid, rowstart, rowmid, newprefix, "0", sem)
|
||||||
)
|
)
|
||||||
quad0result.start()
|
|
||||||
|
|
||||||
if sem.acquire(False):
|
if sem.acquire(False):
|
||||||
Procobj = ReturnableProcess
|
Procobj = ReturnableProcess
|
||||||
@@ -522,7 +521,6 @@ def quadtree_recurse(chunkmap, colstart, colend, rowstart, rowend, prefix, quadr
|
|||||||
quad1result = Procobj(sem, target=quadtree_recurse,
|
quad1result = Procobj(sem, target=quadtree_recurse,
|
||||||
args=(chunkmap, colmid, colend, rowstart, rowmid, newprefix, "1", sem)
|
args=(chunkmap, colmid, colend, rowstart, rowmid, newprefix, "1", sem)
|
||||||
)
|
)
|
||||||
quad1result.start()
|
|
||||||
|
|
||||||
if sem.acquire(False):
|
if sem.acquire(False):
|
||||||
Procobj = ReturnableProcess
|
Procobj = ReturnableProcess
|
||||||
@@ -531,6 +529,11 @@ def quadtree_recurse(chunkmap, colstart, colend, rowstart, rowend, prefix, quadr
|
|||||||
quad2result = Procobj(sem, target=quadtree_recurse,
|
quad2result = Procobj(sem, target=quadtree_recurse,
|
||||||
args=(chunkmap, colstart, colmid, rowmid, rowend, newprefix, "2", sem)
|
args=(chunkmap, colstart, colmid, rowmid, rowend, newprefix, "2", sem)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Start the processes. If one is a fakeprocess, it will do the
|
||||||
|
# processing right here instead.
|
||||||
|
quad0result.start()
|
||||||
|
quad1result.start()
|
||||||
quad2result.start()
|
quad2result.start()
|
||||||
|
|
||||||
# 3rd quadrent always runs in this process, no need to spawn a new one
|
# 3rd quadrent always runs in this process, no need to spawn a new one
|
||||||
|
|||||||
Reference in New Issue
Block a user