Skip to content

Commit

Permalink
Attempt to add multiprocessing support for Windows users
Browse files Browse the repository at this point in the history
  • Loading branch information
VChristiaens committed Jul 31, 2024
1 parent bf89d41 commit 2ed8e35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vip_hci/config/utils_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,13 @@ def pool_map(nproc, fkt, *args, **kwargs):
if not _generator:
res = list(res)
else:
multiprocessing.set_start_method("fork", force=True)
# Check available start methods and pick accordingly (machine-dependent)
avail_methods = multiprocessing.get_all_start_methods()
if 'fork' in avail_methods:
# faster when available
multiprocessing.set_start_method("fork", force=True)
else:
multiprocessing.set_start_method("spawn", force=True)
from multiprocessing import Pool

# deactivate multithreading
Expand Down

0 comments on commit 2ed8e35

Please sign in to comment.