Skip to content
Open
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: 6 additions & 7 deletions altar/bayesian/MPIAnnealing.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,13 @@ def resample(self, annealer, statistics):
accepted, rejected, unlikely = statistics

# add up the acceptance/rejection statistics from all the nodes
accepted = self.communicator.sum(accepted, destination=manager)
rejected = self.communicator.sum(rejected, destination=manager)
unlikely = self.communicator.sum(unlikely, destination=manager)
# and distribute the results back to all processes
accepted = self.communicator.sum(item=accepted)
rejected = self.communicator.sum(item=rejected)
unlikely = self.communicator.sum(item=unlikely)

# if I am the boss
if self.rank == manager:
# chain up
super().resample(annealer=annealer, statistics=(accepted,rejected,unlikely))
# chain up
super().resample(annealer=annealer, statistics=(accepted,rejected,unlikely))

# all done
return self
Expand Down