Suggestion to limit threads for numpy when multicores
@@ -231,6 +231,15 @@ class ChunkRecordingExecutor:
returns.append(res)
else:
n_jobs = min(self.n_jobs, len(all_chunks))
+
+ ######## Do you want to limit the number of threads per process?
+ ######## It has to be done to speed up numpy a lot if multicores
+ ######## Otherwise, np.dot will be slow. How to do that, up to you
+ ######## This is just a suggestion, but here it adds a dependency
+
+ #from threadpoolctl import threadpool_limits
+ #threadpool_limits(1)
+
# parallel
with ProcessPoolExecutor(max_workers=n_jobs,
initializer=worker_initializer,
