From 104e29a5f3219c0c3e5c6511703c2e43a2d4b891 Mon Sep 17 00:00:00 2001 From: Colm Talbot <colm.talbot@ligo.org> Date: Thu, 2 Apr 2020 12:12:10 -0400 Subject: [PATCH] Make sure to remove pool --- bilby/core/sampler/dynesty.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bilby/core/sampler/dynesty.py b/bilby/core/sampler/dynesty.py index 2f4644b51..688efc417 100644 --- a/bilby/core/sampler/dynesty.py +++ b/bilby/core/sampler/dynesty.py @@ -288,7 +288,6 @@ class Dynesty(NestedSampler): self.use_ratio ) ) - self.kwargs["pool"] = self.pool else: _initialize_global_variables( likelihood=self.likelihood, @@ -297,6 +296,7 @@ class Dynesty(NestedSampler): use_ratio=self.use_ratio ) self.pool = None + self.kwargs["pool"] = self.pool def _close_pool(self): if getattr(self, "pool", None) is not None: @@ -304,6 +304,7 @@ class Dynesty(NestedSampler): self.pool.close() self.pool.join() self.pool = None + self.kwargs["pool"] = self.pool logger.info("Finished closing worker pool.") def run_sampler(self): -- GitLab