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

Caching user-defined data #36

Open
ntoles opened this issue Sep 6, 2024 · 5 comments
Open

Caching user-defined data #36

ntoles opened this issue Sep 6, 2024 · 5 comments

Comments

@ntoles
Copy link
Collaborator

ntoles commented Sep 6, 2024

Currently data that is loaded from disk is cached. If I have a user-defined function that requires a heavy calculation, is its output array cached, or is it recomputed every time?
We are thinking of using the user-defined functions to plot 2D temperature maps which would require going over particles. if this has to be recomputed on every time step, this may lag.

@bcaddy
Copy link
Collaborator

bcaddy commented Sep 9, 2024

I don't believe that outputs are currently cached. I wouldn't worry about it unless it turns out to be a big issue, my guess is that the matplotlib calls to plot the temperature will take far more time than the numpy calls to compute the temperature.

@ntoles
Copy link
Collaborator Author

ntoles commented Sep 9, 2024

Plotting 2D arrays is fast. Computing T requires binning and looping over all particles. This will be slow.

@bcaddy
Copy link
Collaborator

bcaddy commented Sep 9, 2024

Maybe, matplotlib plotting is very slow. Performing all the binning and looping with vectorized numpy operations should be fairly performant. Either way, it's not in scope for me at this time.

@ntoles
Copy link
Collaborator Author

ntoles commented Sep 9, 2024

If you or someone else works on this again in the future, it would be useful to know how difficult this task would be. I can't know what's in scope or not without an estimate of what's involved.
So, to rephrase: if I have a computed 2D array from a user-defined function and I want to cache the 2d array, is it a matter of just adding its name to the list of cached data, or one needs to rewrite the caching infrastructure that is in Iseult presently?
Thanks!

@bcaddy
Copy link
Collaborator

bcaddy commented Sep 9, 2024

I'm not 100% sure. I think it wouldn't be too challenging but it would require some moderate modifications. Maybe a week to have a version working? But again, this is all premature optimization, until the temperature plots have been implemented and profiled it's impossible to say if it would even be worth doing the caching.

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