dfm/emcee

In emcee.EnsembleSampler threads command is not working

enitree opened this issue · 0 comments

General information:

  • emcee version: 3.1.4
  • platform: ubuntu 22.04.2
    linux fedora 5.19.8
  • installation method (pip/conda/source/other?):

Problem description:

Hi ! so i am trying to model surface spots of a star using starry process (Ensemble Analysis to be precise).For posterior analysis i am using plain vanilla emcee( as recommended in starry_process documentation). whenever i initiate the MCMC with required number of walkers (in my case 30) and steps(in my case 5000) the code runs across all the cores available in the cpu. I have tried to use the threads command of emcee.EnsembleSampler by assigning numerical values to them. Irrespective of me assigning thread value, the code keeps on running across all the available cores.

Surprisingly, when i ran the code for the first time on the system it occupied a single core. While trying to figure out if the speed of the code can be enhanced I ran 'threads' and even then for threads=10 the code ran over all the cores. Since then i am unable to control the number of cores across which we want the code to run

since the time consumption while running across all the cores and single cores is similar we plan on to run multiple ensemble across various single core to fasten our process.

Expected behavior:

it is expected that the code runs over specified no of cores

Actual behavior:

it is running across all the cores

What have you tried so far?:

i have tried

import multiprocessing
multiprocessing.set_start_method("thread")

i have tried switching systems of different cores

Minimal example:

import emcee

# sample code goes here...

image