Created
November 30, 2012 17:41
-
-
Save joezuntz/4177285 to your computer and use it in GitHub Desktop.
Emcee bugfix patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/emcee/utils.py b/emcee/utils.py | |
index c5685d3..0aa63c7 100644 | |
--- a/emcee/utils.py | |
+++ b/emcee/utils.py | |
@@ -163,19 +163,25 @@ if MPI is not None: | |
F = _function_wrapper(function) | |
# Tell all the workers what function to use. | |
+ requests = [] | |
+ | |
for i in range(self.size): | |
- self.comm.isend(F, dest=i + 1) | |
+ r=self.comm.isend(F, dest=i + 1) | |
+ requests.append(r) | |
+ MPI.Request.waitall(requests) | |
# Send all the tasks off. Do not wait for them to be received, | |
# just continue. | |
+ requests = [] | |
for i, task in enumerate(tasks): | |
worker = i % self.size + 1 | |
if self.debug: | |
print(u"Sent task {0} to worker {1} with tag {2}." | |
.format(task, worker, i)) | |
- self.comm.isend(task, dest=worker, tag=i) | |
+ r=self.comm.isend(task, dest=worker, tag=i) | |
+ requests.append(r) | |
results = [] | |
- | |
+ MPI.Request.waitall(requests) | |
# Now wait for the answers. | |
for i in range(ntask): | |
worker = i % self.size + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment