Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NestedSampling: make mc_walker optional or change the way workers are set up #23

Open
smcantab opened this issue Dec 9, 2014 · 1 comment

Comments

@smcantab
Copy link
Collaborator

smcantab commented Dec 9, 2014

When using the distributed parallelisation we build an mc_walker for each worker but are then also required to pass the mcwalker to the NestedSampling class. This particular instance of the mc_walker will not be used, because it is up to the workers to do the MCMC.

I find it confusing that the nested sampling object takes something that it doesn't need. So we could either make the mc_walker an optional parameter or we could pass the mc_walker to the workers from the master. Although dependency injection in this case would be more elegant, this solution is more cumbersome to implement and we would have to deal with making the mc_walker pickable.

@js850 any ideas?

@js850
Copy link
Owner

js850 commented Dec 9, 2014

I would just put in the documentation that mc_walker will be ignored if we use distributed parallelization.

I was just looking over the NestedSampling class and it's a bit of a mess with the three different versions of how to do mc walking. Would it make sense to have a simple non parallel class with the rest inheriting from it and overloading certain functions?

class NestedSampling(object):
class NestedSamplingMP(NestedSampling):
class NestedSamplingPyro(NestedSampling):
class NestedSamplingMPI(NestedSampling):

Then they would all be independent. And they would only have to overload the function they need (e.g. _do_monte_carlo_chain().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants