@@ -19,6 +19,9 @@ class Executor:
1919 an interactive Jupyter notebook.
2020
2121 Args:
22+ max_workers (int): for backwards compatibility with the standard library, max_workers also defines the number of
23+ cores which can be used in parallel - just like the max_cores parameter. Using max_cores is
24+ recommended, as computers have a limited number of compute cores.
2225 max_cores (int): defines the number cores which can be used in parallel
2326 cores_per_worker (int): number of MPI cores to be used for each function call
2427 threads_per_core (int): number of OpenMP threads to be used for each function call
@@ -64,6 +67,7 @@ class Executor:
6467
6568 def __init__ (
6669 self ,
70+ max_workers : int = 1 ,
6771 max_cores : int = 1 ,
6872 cores_per_worker : int = 1 ,
6973 threads_per_core : int = 1 ,
@@ -84,6 +88,7 @@ def __init__(
8488
8589 def __new__ (
8690 cls ,
91+ max_workers : int = 1 ,
8792 max_cores : int = 1 ,
8893 cores_per_worker : int = 1 ,
8994 threads_per_core : int = 1 ,
@@ -108,6 +113,9 @@ def __new__(
108113 requires the SLURM workload manager to be installed on the system.
109114
110115 Args:
116+ max_workers (int): for backwards compatibility with the standard library, max_workers also defines the
117+ number of cores which can be used in parallel - just like the max_cores parameter. Using
118+ max_cores is recommended, as computers have a limited number of compute cores.
111119 max_cores (int): defines the number cores which can be used in parallel
112120 cores_per_worker (int): number of MPI cores to be used for each function call
113121 threads_per_core (int): number of OpenMP threads to be used for each function call
@@ -135,6 +143,7 @@ def __new__(
135143 """
136144 if not disable_dependencies :
137145 return ExecutorWithDependencies (
146+ max_workers = max_workers ,
138147 max_cores = max_cores ,
139148 cores_per_worker = cores_per_worker ,
140149 threads_per_core = threads_per_core ,
@@ -152,6 +161,7 @@ def __new__(
152161 else :
153162 _check_refresh_rate (refresh_rate = refresh_rate )
154163 return create_executor (
164+ max_workers = max_workers ,
155165 max_cores = max_cores ,
156166 cores_per_worker = cores_per_worker ,
157167 threads_per_core = threads_per_core ,
0 commit comments