Skip to content
Snippets Groups Projects
Commit 365a85b5 authored by Jean-Baptiste Bayle's avatar Jean-Baptiste Bayle
Browse files

Change default number of workers to three

parent a7faad92
No related branches found
No related tags found
1 merge request!134Parallelize MOSA and SC quantities
...@@ -31,7 +31,7 @@ class ForEachObject(abc.ABC): ...@@ -31,7 +31,7 @@ class ForEachObject(abc.ABC):
self.dict = {mosa: values[mosa] for mosa in self.indices()} self.dict = {mosa: values[mosa] for mosa in self.indices()}
elif callable(values): elif callable(values):
if concurrent: if concurrent:
with ThreadPoolExecutor() as executor: with ThreadPoolExecutor(max_workers=3) as executor:
indices = self.indices() indices = self.indices()
computed_values = executor.map(values, indices) computed_values = executor.map(values, indices)
self.dict = dict(zip(indices, computed_values)) self.dict = dict(zip(indices, computed_values))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment