diff --git a/cosmosis/main.py b/cosmosis/main.py index b48e56ba..8870e22a 100755 --- a/cosmosis/main.py +++ b/cosmosis/main.py @@ -430,8 +430,8 @@ def run_cosmosis(ini, pool=None, pipeline=None, values=None, priors=None, overri run_count_total = pipeline.run_count run_count_ok_total = pipeline.run_count_ok else: - run_count_total = pool.comm.allreduce(pipeline.run_count) - run_count_ok_total = pool.comm.allreduce(pipeline.run_count_ok) + run_count_total = pool.allreduce(pipeline.run_count) + run_count_ok_total = pool.allreduce(pipeline.run_count_ok) if is_root and sampler_name != 'test': logs.overview(f"Total posterior evaluations = {run_count_total} across all processes") diff --git a/cosmosis/runtime/mpi_pool.py b/cosmosis/runtime/mpi_pool.py index 64ec276b..2d3ed388 100644 --- a/cosmosis/runtime/mpi_pool.py +++ b/cosmosis/runtime/mpi_pool.py @@ -114,6 +114,9 @@ def send(self, data, dest=0, tag=0): def recv(self, source=0, tag=0): return self.comm.recv(source, tag) + def allreduce(self, data): + return self.comm.allreduce(data) + def close(self): if self.is_master(): for i in range(1, self.size): diff --git a/cosmosis/runtime/pipeline.py b/cosmosis/runtime/pipeline.py index 11af7ed9..5f6922fd 100644 --- a/cosmosis/runtime/pipeline.py +++ b/cosmosis/runtime/pipeline.py @@ -1307,11 +1307,11 @@ def _set_likelihood_names_from_block(self, data): self.likelihood_names = likelihood_names # Tell the user what we found. - logs.overview("Using likelihooods from first run:") + logs.noisy("Using likelihooods from first run:") for name in self.likelihood_names: - logs.overview(f" - {name}") + logs.noisy(f" - {name}") if not self.likelihood_names: - logs.overview(" - (None found)") + logs.noisy(" - (None found)") def _extract_likelihoods(self, data): "Extract the likelihoods from the block" diff --git a/cosmosis/runtime/process_pool.py b/cosmosis/runtime/process_pool.py index 5f751b4e..0ea3848d 100644 --- a/cosmosis/runtime/process_pool.py +++ b/cosmosis/runtime/process_pool.py @@ -25,6 +25,8 @@ def bcast(self, data): def gather(self, data): return self.data + def allreduce(self, data): + return self.data def __enter__(self): return self