Skip to content
Snippets Groups Projects
Commit 60e8f77f authored by Josh Willis's avatar Josh Willis Committed by Gregory Ashton
Browse files

Add pool.join after pool.close in bilby.gw.conversion

parent e04d1190
No related branches found
No related tags found
1 merge request!1084Add pool.join after pool.close in bilby.gw.conversion
...@@ -33,6 +33,7 @@ James A Clark ...@@ -33,6 +33,7 @@ James A Clark
Jeremy G Baier Jeremy G Baier
John Veitch John Veitch
Joshua Brandt Joshua Brandt
Josh Willis
Katerina Chatziioannou Katerina Chatziioannou
Kaylee de Soto Kaylee de Soto
Khun Sang Phukon Khun Sang Phukon
......
...@@ -1167,6 +1167,7 @@ def compute_snrs(sample, likelihood, npool=1): ...@@ -1167,6 +1167,7 @@ def compute_snrs(sample, likelihood, npool=1):
) )
new_samples = pool.map(_compute_snrs, tqdm(fill_args, file=sys.stdout)) new_samples = pool.map(_compute_snrs, tqdm(fill_args, file=sys.stdout))
pool.close() pool.close()
pool.join()
else: else:
new_samples = [_compute_snrs(xx) for xx in tqdm(fill_args, file=sys.stdout)] new_samples = [_compute_snrs(xx) for xx in tqdm(fill_args, file=sys.stdout)]
...@@ -1307,6 +1308,7 @@ def generate_posterior_samples_from_marginalized_likelihood( ...@@ -1307,6 +1308,7 @@ def generate_posterior_samples_from_marginalized_likelihood(
if pool is not None: if pool is not None:
pool.close() pool.close()
pool.join()
new_samples = np.concatenate( new_samples = np.concatenate(
[np.array(val) for key, val in cached_samples_dict.items() if key != "_samples"] [np.array(val) for key, val in cached_samples_dict.items() if key != "_samples"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment