dfm/emcee — pull request #110 by juliohm (2014-03-24 17:00:51+00:00)
Title: Add bcast collective operation to the MPIPool class

We often need results in the `master` process to be visible in all the `slaves` for doing *expensive* post-processing. This patch wraps `mpi4py` bcast operation to avoid `emcee` users going down such useful pool abstraction layer.

**Example of usage:**
```python
import emcee
import numpy as np

pool = emcee.utils.MPIPool()

if pool.is_master():
# do MCMC machinery to produce data
data = np.array([1,2,3])

# tell slaves to proceed
pool.close()
else:
# create dummy variable and wait for instructions
data = None
pool.wait()

# broadcast results
results = pool.bcast(data)

# slaves now have the correct data, continue the heavy work...
```