diff --git a/pylot/core/util/generate_array_maps.py b/pylot/core/util/generate_array_maps.py index ebb83c5f..0e7a9d64 100755 --- a/pylot/core/util/generate_array_maps.py +++ b/pylot/core/util/generate_array_maps.py @@ -42,7 +42,7 @@ def main(project_file_path, manual=False, auto=True, file_format='png', f_ext='' for item in input_list: array_map_worker(item) else: - pool = multiprocessing.Pool(ncores) + pool = multiprocessing.Pool(ncores, maxtasksperchild=1000) pool.map(array_map_worker, input_list) pool.close() pool.join() diff --git a/pylot/core/util/thread.py b/pylot/core/util/thread.py index d3b80b25..86ca35fa 100644 --- a/pylot/core/util/thread.py +++ b/pylot/core/util/thread.py @@ -160,7 +160,7 @@ class MultiThread(QThread): try: if not self.ncores: self.ncores = multiprocessing.cpu_count() - pool = multiprocessing.Pool(self.ncores) + pool = multiprocessing.Pool(self.ncores, maxtasksperchild=1000) self.data = pool.map_async(self.func, self.args, callback=self.emitDone) # self.data = pool.apply_async(self.func, self.shotlist, callback=self.emitDone) #emit each time returned pool.close() diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index 42e500b2..a7db759d 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -120,7 +120,7 @@ def gen_Pool(ncores=0): print('gen_Pool: Generated multiprocessing Pool with {} cores\n'.format(ncores)) - pool = multiprocessing.Pool(ncores) + pool = multiprocessing.Pool(ncores, maxtasksperchild=100) return pool