Skip to content

Commit

Permalink
Do not call shutdown() in run_parallel() when jobs=1 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaFicarelli authored May 3, 2024
1 parent 0feee35 commit 7e67afa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

Version 0.2.4
-------------

Bug fixes
~~~~~~~~~

- Do not call ``get_reusable_executor().shutdown()`` when tasks are run serially in ``run_parallel()``.

Version 0.2.3
-------------

Expand Down
2 changes: 1 addition & 1 deletion src/blueetl_core/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def run_parallel(
for i, task in enumerate(tasks)
)
finally:
if shutdown_executor and (not backend or backend == "loky"):
if shutdown_executor and (not backend or backend == "loky") and jobs != 1:
# shutdown the pool of processes used by loky
get_reusable_executor().shutdown(wait=True)

Expand Down

0 comments on commit 7e67afa

Please sign in to comment.