solve bug in custom pool multiprocessing
This commit is contained in:
+7
-4
@@ -1,3 +1,4 @@
|
||||
from mypool import MyPool
|
||||
from postprocessor import *
|
||||
|
||||
|
||||
@@ -34,10 +35,12 @@ class Aggregator:
|
||||
)
|
||||
|
||||
if self.pp_params.process.num_process > 1:
|
||||
pool = Pool(processes=self.pp_params.process.num_process)
|
||||
done = pool.map(map_fn, run_num)
|
||||
pool = MyPool(processes=self.pp_params.process.num_process)
|
||||
result = pool.map(map_fn, run_num)
|
||||
pool.close()
|
||||
pool.join()
|
||||
else:
|
||||
done = map(map_fn, run_num)
|
||||
self.just_done.extend([item for li in done for item in li])
|
||||
result = map(map_fn, run_num)
|
||||
|
||||
if np.any([res is not None for res in result]):
|
||||
self.just_done.append(dep)
|
||||
|
||||
Reference in New Issue
Block a user