diff --git a/gmap.py b/gmap.py index 2effa31..69b25f3 100755 --- a/gmap.py +++ b/gmap.py @@ -40,7 +40,9 @@ def main(): if options.procs > 1: for i, (col, row, filename) in enumerate(chunks): 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" if not os.path.exists(destdir): diff --git a/world.py b/world.py index d023c04..6fa893e 100644 --- a/world.py +++ b/world.py @@ -513,7 +513,6 @@ def quadtree_recurse(chunkmap, colstart, colend, rowstart, rowend, prefix, quadr quad0result = Procobj(sem, target=quadtree_recurse, args=(chunkmap, colstart, colmid, rowstart, rowmid, newprefix, "0", sem) ) - quad0result.start() if sem.acquire(False): Procobj = ReturnableProcess @@ -522,7 +521,6 @@ def quadtree_recurse(chunkmap, colstart, colend, rowstart, rowend, prefix, quadr quad1result = Procobj(sem, target=quadtree_recurse, args=(chunkmap, colmid, colend, rowstart, rowmid, newprefix, "1", sem) ) - quad1result.start() if sem.acquire(False): Procobj = ReturnableProcess @@ -531,6 +529,11 @@ def quadtree_recurse(chunkmap, colstart, colend, rowstart, rowend, prefix, quadr quad2result = Procobj(sem, target=quadtree_recurse, 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() # 3rd quadrent always runs in this process, no need to spawn a new one