Skip to content

Commit d95d6ca

Browse files
[major] Refactor the Executor interface (#548)
* [major] Refactor the Executor interface Replace the backend parameter from the initialization of the Executor class with individual executor classes for the individual backends: * `Executor(backend="local")` becomes `from executorlib import LocalExecutor§ * `Executor(backend="flux_allocation")` becomes `from executorlib import FluxAllocationExecutor§ * `Executor(backend="flux_submission")` becomes `from executorlib import FluxSubmissionExecutor§ * `Executor(backend="slurm_allocation")` becomes "SlurmAllocationExecutor" * `Executor(backend="slurm_submission")` becomes `from executorlib import SlurmSubmissionExecutor` This has two advantages: On the one hand it is less error prone to mistyping the backend name, as the user can use auto completion to import the right module. On the other hand it is more consistent with the standard library which defines the `ProcessPoolExecutor` and the `ThreadPoolExecutor`, rather than a `backend` parameter. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix test * update benchmark * move interfaces to individual modules * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove create * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove redundant functionality * Move graph tests * remove core check * clean up * more tests * fix import * more fixes * Rename LocalExecutor to SingleNodeExecutor * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test block allocation * fix * flux fix * Rename interfaces * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix docstrings * add docstrings to create_*_executor() function * fix test * merge --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 11d44cc commit d95d6ca

24 files changed

+1820
-773
lines changed

.github/workflows/unittest-flux-mpich.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
timeout-minutes: 5
3535
run: >
3636
flux start
37-
python -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py tests/test_cache_executor_pysqa_flux.py;
37+
python -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py tests/test_cache_executor_pysqa_flux.py tests/test_plot_dependency_flux.py;

.github/workflows/unittest-flux-openmpi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
timeout-minutes: 5
3535
run: >
3636
flux start
37-
coverage run -a --omit="executorlib/_version.py,tests/*" -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py tests/test_cache_executor_pysqa_flux.py;
37+
coverage run -a --omit="executorlib/_version.py,tests/*" -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py tests/test_cache_executor_pysqa_flux.py tests/test_plot_dependency_flux.py;
3838
coverage xml
3939
env:
4040
PYMPIPOOL_PMIX: "pmix"

executorlib/__init__.py

Lines changed: 14 additions & 246 deletions
Large diffs are not rendered by default.

executorlib/interactive/create.py

Lines changed: 0 additions & 295 deletions
This file was deleted.

executorlib/interfaces/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)