Skip to content

Commit

Permalink
Permit specification of multiprocessing start methods other than "spa…
Browse files Browse the repository at this point in the history
…wn" (e.g. "dragon" or "fork"). (#554)
  • Loading branch information
applio authored Sep 17, 2024
1 parent 3dbf6d6 commit 4ff032b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cubed/runtime/executors/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ async def async_execute_dag(
check_runtime_memory(spec, max_workers)
if use_processes:
max_tasks_per_child = kwargs.pop("max_tasks_per_child", None)
context = multiprocessing.get_context("spawn")
if isinstance(use_processes, str):
context = multiprocessing.get_context(use_processes)
else:
context = multiprocessing.get_context("spawn")
# max_tasks_per_child is only supported from Python 3.11
if max_tasks_per_child is None:
concurrent_executor = ProcessPoolExecutor(
Expand Down

0 comments on commit 4ff032b

Please sign in to comment.