Skip to content

Commit ccee7e8

Browse files
committed
update init
1 parent b9af945 commit ccee7e8

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

executorlib/__init__.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Executor:
4747
flux_executor (flux.job.FluxExecutor): Flux Python interface to submit the workers to flux
4848
flux_executor_pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None (Flux only)
4949
flux_executor_nesting (bool): Provide hierarchically nested Flux job scheduler inside the submitted function.
50+
pysqa_config_directory (str, optional): path to the pysqa config directory (only for pysqa based backend).
5051
hostname_localhost (boolean): use localhost instead of the hostname to establish the zmq connection. In the
5152
context of an HPC cluster this essential to be able to communicate to an
5253
Executor running on a different compute node within the same allocation. And
@@ -95,6 +96,7 @@ def __init__(
9596
flux_executor=None,
9697
flux_executor_pmi_mode: Optional[str] = None,
9798
flux_executor_nesting: bool = False,
99+
pysqa_config_directory: Optional[str] = None,
98100
hostname_localhost: Optional[bool] = None,
99101
block_allocation: bool = True,
100102
init_function: Optional[callable] = None,
@@ -115,6 +117,7 @@ def __new__(
115117
flux_executor=None,
116118
flux_executor_pmi_mode: Optional[str] = None,
117119
flux_executor_nesting: bool = False,
120+
pysqa_config_directory: Optional[str] = None,
118121
hostname_localhost: Optional[bool] = None,
119122
block_allocation: bool = True,
120123
init_function: Optional[callable] = None,
@@ -149,6 +152,7 @@ def __new__(
149152
flux_executor (flux.job.FluxExecutor): Flux Python interface to submit the workers to flux
150153
flux_executor_pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None (Flux only)
151154
flux_executor_nesting (bool): Provide hierarchically nested Flux job scheduler inside the submitted function.
155+
pysqa_config_directory (str, optional): path to the pysqa config directory (only for pysqa based backend).
152156
hostname_localhost (boolean): use localhost instead of the hostname to establish the zmq connection. In the
153157
context of an HPC cluster this essential to be able to communicate to an
154158
Executor running on a different compute node within the same allocation. And
@@ -180,7 +184,24 @@ def __new__(
180184
resource_dict.update(
181185
{k: v for k, v in default_resource_dict.items() if k not in resource_dict}
182186
)
183-
if not disable_dependencies:
187+
if "pysqa_" in backend and not plot_dependency_graph:
188+
from executorlib.cache.executor import create_file_executor
189+
190+
return create_file_executor(
191+
max_workers=max_workers,
192+
backend=backend,
193+
max_cores=max_cores,
194+
cache_directory=cache_directory,
195+
resource_dict=resource_dict,
196+
flux_executor=flux_executor,
197+
flux_executor_pmi_mode=flux_executor_pmi_mode,
198+
flux_executor_nesting=flux_executor_nesting,
199+
pysqa_config_directory=pysqa_config_directory,
200+
hostname_localhost=hostname_localhost,
201+
block_allocation=block_allocation,
202+
init_function=init_function,
203+
)
204+
elif not disable_dependencies:
184205
return ExecutorWithDependencies(
185206
max_workers=max_workers,
186207
backend=backend,

0 commit comments

Comments
 (0)