MCMC sampler does not work with MPI=False and threadCount > 1
See original GitHub issueThe schwimmbad.choose_pool
method, when mpi=False
and threadCount
> 1 returns a MultiPool object that has no is_master
attribute, hence the following error :
File "/Users/aymericg/Documents/EPFL/PhD_LASTRO/Code/Forked/lenstronomy_forked/lenstronomy/Workflow/fitting_sequence.py", line 94, in fit_sequence
mcmc_output = self.mcmc(**kwargs)
File "/Users/aymericg/Documents/EPFL/PhD_LASTRO/Code/Forked/lenstronomy_forked/lenstronomy/Workflow/fitting_sequence.py", line 230, in mcmc
threadCount=threadCount, progress=progress)
File "/Users/aymericg/Documents/EPFL/PhD_LASTRO/Code/Forked/lenstronomy_forked/lenstronomy/Sampling/sampler.py", line 149, in mcmc_emcee
if pool.is_master():
AttributeError: 'MultiPool' object has no attribute 'is_master'
In addition, I see that the new schwimmbad way of dealing with pools calls the multiprocessing
module instead of the multiprocess
, as it was done before in lenstronomy, and which is more robust because of pickling issues in multiprocessing
. @ajshajib , could you please look into that since you introduced this change ?
I did not test for the PSO, but it’s likely to give the same result.
In the meantime, I will temporarily make my own fork of schwimmbad to fix that, but it’s not viable to link lenstronomy to this fork.
Issue Analytics
- State:
- Created 4 years ago
- Comments:20
Top Results From Across the Web
Source code for lenstronomy.Sampling.sampler
[docs]class Sampler(object): """ class which executes the different sampling methods Available are: MCMC with emcee a Particle Swarm Optimizer.
Read more >MCMC sampling does not work when execute - Modeling
Hi everyone, I currently have trouble executing the below stan model, but I could not detect why it keeps giving me this error...
Read more >MCMC Settings
The sampling is done by the software JAGS (“Just Another Gibbs Sampler”), which performs Gibbs sampling. JointAI pre-processes the data to get ...
Read more >MCMC sampling for dummies
Setting up the problem¶. First, lets import our modules. In [1]:.
Read more >MCMC convergence - bayesian - Cross Validated
Sometimes, the sampler you are using might be not the best choice. For example, if your problem deals with continuous variables with a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok thanks @sibirrer , I’ll prepare the changes
up to you @aymgal. It would be great if we can minimize outside dependence on ‘unstable’ development. If you implement it in lenstronomy, I would not call it a ‘hack’ if you well document the in- and outputs, its current purpose and reason for doing it there.