Commit 923d1563 authored by Colm Talbot's avatar Colm Talbot
Browse files

Make checkpointing even safer

parent 77bba948
Pipeline #115778 failed with stage
in 23 minutes and 18 seconds
......@@ -546,6 +546,7 @@ class Dynesty(NestedSampler):
self.sampler.versions = dict(
bilby=bilby_version, dynesty=dynesty_version
)
del self.sampler.pool, self.sampler.M
if dill.pickles(self.sampler):
safe_file_dump(self.sampler, self.resume_file, dill)
logger.info("Written checkpoint file {}".format(self.resume_file))
......@@ -554,6 +555,12 @@ class Dynesty(NestedSampler):
"Cannot write pickle resume file! "
"Job will not resume if interrupted."
)
self.sampler.pool = self.pool
if self.sampler.pool is not None:
self.sampler.M = self.sampler.pool.M
else:
self.sampler.M = map
def plot_current_state(self):
if self.check_point_plot:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment