get_pool

gala.util.get_pool(mpi=False, threads=None, **kwargs)[source]

Get a pool object to pass to emcee for parallel processing. If mpi is False and threads is None, pool is None.

Parameters:

mpi : bool

Use MPI or not. If specified, ignores the threads kwarg.

threads : int (optional)

If mpi is False and threads is specified, use a Python multiprocessing pool with the specified number of threads.

**kwargs

Any other keyword arguments are passed through to the pool initializers.