Skip to content

Commit c090401

Browse files
0.29.17
multiprocessing
1 parent c21c0b9 commit c090401

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotpython"
10-
version = "0.29.16"
10+
version = "0.29.17"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotpython/spot/spot.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
# matplotlib.use("TkAgg")
5757
# matplotlib.use("Agg")
5858

59+
60+
# for multiprocessing:
61+
# check if context is already set to "spawn"
62+
# if not, set it to "spawn"
63+
# Check if the context is already set to "spawn"
64+
if get_start_method(allow_none=True) != "spawn":
65+
set_start_method("spawn", force=True)
66+
5967
logger = logging.getLogger(__name__)
6068
# configure the handler and formatter as needed
6169
py_handler = logging.FileHandler(f"{__name__}.log", mode="w")
@@ -202,13 +210,6 @@ def __init__(
202210
self.optimizer_control = optimizer_control
203211
self.surrogate_control = surrogate_control
204212

205-
# for multiprocessing:
206-
# check if context is already set to "spawn"
207-
# if not, set it to "spawn"
208-
# Check if the context is already set to "spawn"
209-
if get_start_method(allow_none=True) != "spawn":
210-
set_start_method("spawn", force=True)
211-
212213
# small value:
213214
self.eps = sqrt(spacing(1))
214215

0 commit comments

Comments
 (0)