Skip to content

Commit 7397198

Browse files
author
Julian Blank
committed
Merge branch 'master' of https://github.com/JoshKarpel/pymoo
2 parents 6f73e33 + 111a4ab commit 7397198

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pymoo/model/problem.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def __init__(self,
5050
elementwise_evaluation : bool
5151
5252
parallelization : str or tuple
53+
See :ref:`nb_parallelization` for guidance on parallelization.
5354
5455
"""
5556

@@ -460,7 +461,12 @@ def calc_constraint_violation(G):
460461

461462
def __getstate__(self):
462463
state = self.__dict__.copy()
463-
state["parallelization"] = None
464+
465+
# If the parallelization is starmap,
466+
# we can't pickle self with the starmapper function.
467+
if state["parallelization"] is not None and state["parallelization"][0] == "starmap":
468+
state["parallelization"] = None
469+
464470
return state
465471

466472
# makes all the output at least 2-d dimensional

0 commit comments

Comments
 (0)