cayenne icon indicating copy to clipboard operation
cayenne copied to clipboard

Add Progress Bar for Simulation.simulate

Open jonstrutz11 opened this issue 5 years ago • 4 comments

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.

jonstrutz11 avatar Aug 18 '20 13:08 jonstrutz11

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.

sriki18 avatar Aug 22 '20 17:08 sriki18

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...).

jonstrutz11 avatar Aug 22 '20 21:08 jonstrutz11

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

sriki18 avatar Aug 23 '20 23:08 sriki18

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 :/

jonstrutz11 avatar Aug 24 '20 13:08 jonstrutz11