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

Parallelise random walk #3

Open
2 tasks
ignasiialemany opened this issue Jan 22, 2021 · 2 comments
Open
2 tasks

Parallelise random walk #3

ignasiialemany opened this issue Jan 22, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@ignasiialemany
Copy link
Contributor

ignasiialemany commented Jan 22, 2021

The code is optimised to run in serial, but if a large number of walkers and/or time steps is used the runtime can be a limiting factor. Splitting walkers between cores/threads allows for faster overall execution but requires refactoring of the code.

  • Implement parallel random number generation using numpy to ensure reproducibility irrespective of parallelisation
  • API changes to the run and one_step methods only via optional arguments (kwargs) that default to serial execution
@janniklasrose janniklasrose changed the title Parallelise random walk code in high-level methods. Parallelise random walk Jan 22, 2021
@janniklasrose janniklasrose added the enhancement New feature or request label Jan 22, 2021
@janniklasrose
Copy link
Owner

janniklasrose commented Feb 1, 2021

Added support for random number streams in #4. I suggest adding a ParallelMonteCarlo class that wraps around/extends/replaces the existing MonteCarlo class with the methods overridden to handle parallelisation

@janniklasrose
Copy link
Owner

The only caveat would be that results are not reproducible between runs with different numbers of threads, but I don't see a way around that without major refactoring anyway.

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

No branches or pull requests

2 participants