Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions autofit/non_linear/search/nest/nautilus/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,19 @@ def fit_multiprocessing(self, fitness, model, analysis):
fitness=fitness
)

# Nautilus creates its own multiprocessing.Pool internally when pool=N.
# Close them here so their finalizers don't fire at interpreter shutdown
# (after pickle has been torn down, causing AttributeError on Pool.__del__).
for pool_attr in ("pool_l", "pool_s"):
pool = getattr(search_internal, pool_attr, None)
if pool is not None:
try:
pool.close()
pool.join()
except Exception:
pass
setattr(search_internal, pool_attr, None)

return search_internal

def call_search(self, search_internal, model, analysis, fitness):
Expand Down
Loading