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

Add Progress Bar for Simulation.simulate #131

Open
jonstrutz11 opened this issue Aug 18, 2020 · 4 comments
Open

Add Progress Bar for Simulation.simulate #131

jonstrutz11 opened this issue Aug 18, 2020 · 4 comments

Comments

@jonstrutz11
Copy link

It would be nice to have a progress bar displayed during simulations (especially in Jupyter Notebook).

However, since simulations end at either a specific time or iteration, maybe you would need two separate progress bars? One for time, and one for # iterations?

What do you think?

Maybe the tqdm library could be useful.

@sriki18
Copy link
Collaborator

sriki18 commented Aug 22, 2020

This sounds like a good idea. Reporting progress from within a simulation is difficult for two reasons:

  1. The simulations are run in parallel.
  2. The underlying code is in Cython, and will be harder to work with.

Out of curiosity, how long does each repetition take?

We believe reporting progress on the number of repetitions is much more doable, although it is still a little tricky again because of the multiprocessing. Do you have any experience working on using tqdm with multiprocessing? Right now we are focusing on efforts on writing a paper, so this would be lower priority.

@jonstrutz11
Copy link
Author

Ah, that is a good point that I didn't think about.

Each rep in my model takes roughly 10 minutes currently, but I am planning on expanding the model in the future.

And I do not. The most similar thing I can think of is there is a progress bar (via tqdm) feature for pymc3 which uses multiprocessing (basically each process run 1 mcmc chain, sort of analogous to 1 rep I suppose?). Not sure how they implemented it or if that could even carry over to cayenne (my guess is no, but who knows...).

@sriki18
Copy link
Collaborator

sriki18 commented Aug 23, 2020

Oh wow, that's much longer than I expected. It must be a pretty big system. Or maybe you are running it for a longer time? Also which algorithm are you using?

That's cool actually, likely shows that it can be done. We will take a look at it when we find some time

@jonstrutz11
Copy link
Author

Yes it is quite a large system (100,000+ molecules) but with only a few unique species (~10). Because I'm interested in using KMC to generate many (1000s) of polymer sequences I need to start with many molecules in the system. Ideally, more than I am currently. I run it for 3600 s just using the direct algorithm. I tried Tau adaptive and didn't see much improvement in speed :/

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

No branches or pull requests

3 participants