Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ap#1316)

* try switching to MultiProcessing

* updating tutorial comment

* default to multiprocessing; make interface more forgiving
  • Loading branch information
bknueven authored Feb 28, 2024
1 parent 5f63995 commit 8c49260
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/parameter_sweep/parallel/parallel_manager_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def create_parallel_manager(parallel_manager_class=None, **kwargs):

number_of_subprocesses = kwargs.get("number_of_subprocesses", 1)
if should_fan_out(number_of_subprocesses):
parallel_backend = kwargs.get("parallel_back_end", "ConcurrentFutures")
if parallel_backend == "ConcurrentFutures":
parallel_backend = kwargs.get("parallel_back_end", "multiprocessing")
if parallel_backend.lower() in ("concurrentfutures", "concurrent.futures"):
return ConcurrentFuturesParallelManager(number_of_subprocesses)
elif parallel_backend == "MultiProcessing":
elif parallel_backend.lower() in ("multiprocessing",):
return MultiprocessingParallelManager(number_of_subprocesses)
elif parallel_backend == "RayIo":
elif parallel_backend.lower() in ("rayio", "ray"):
if ray_avaialble:
return RayIoParallelManager(number_of_subprocesses)
else:
Expand Down
2 changes: 1 addition & 1 deletion tutorials/parameter_sweep_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
" \"optimize_kwargs\": {\"solver\": solver, \"check_termination\": False},\n",
" \"initialize_function\": None,\n",
" \"initialize_kwargs\": {},\n",
" \"parallel_back_end\": \"ConcurrentFutures\", # Multiprocessing, MPI, Ray available\n",
" \"parallel_back_end\": \"MultiProcessing\", # ConcurrentFutures, MPI, Ray available\n",
" \"number_of_subprocesses\": num_procs,\n",
" \n",
" # Additional useful keyword arguments\n",
Expand Down

0 comments on commit 8c49260

Please sign in to comment.