dfm / emcee

The Python ensemble sampling toolkit for affine-invariant MCMC

Home Page:https://emcee.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using multithreading from tutorial doesnt seem to work

MichaelKachanyuk opened this issue · comments

General information:

  • emcee version: 3.1.6
  • platform: Windows/VS code/Jupyter Notebook
  • installation method (pip/conda/source/other?): pip install

Problem description:

Expected behavior:

Should run mcmc sampler and make run-time shorter

Actual behavior:

Code cell continues running and does not seem to make sampler run-time any shorter

What have you tried so far?:

changing threads/core/nwalkers

Minimal example:

with Pool() as pool:
sampler2 = mc.EnsembleSampler(nwalkers=10, ndim=4, log_prob_fn=ln_pdf2, args = [], pool = pool)
sampler2.run_mcmc(starts2, 1000, progress = True)

14m 20.3s and counting...

image

import emcee

# sample code goes here...

with Pool() as pool:
    sampler2 = mc.EnsembleSampler(nwalkers=10, ndim=4, log_prob_fn=ln_pdf2, args = [], pool = pool)
    sampler2.run_mcmc(starts2, 1000, progress = True)