-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pre-Initialize model xarray with timesteps #77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjordan29, Nice work! I looked over your code carefully, and I'm quite impressed (although I didn't run anything). I love the new examples/dev_sandbox/performance_profiling_tsm.py
and its sister notebook. The plots are quite compelling, and it will be great to continue to add to it.
I'm also impressed with your work in src/clearwater_modules/base.py
to properly set up the pre-initialized xarray datasets with all their coords. I imagine that sets us up nicely to tackle #69.
Thanks for updating and rerunning examples/model_architecture.ipynb
.
Let's merge this!
…yTeam/ClearWater-modules into performance-pre-init
Closes #68
This PR adds a new required
time_steps
parameter for instantiation of the base model class. Writing to a pre-initialized array rather than continuously concatenating arrays has speed advantages, particularly for large model grids and a large number of model timesteps -- as shown in #68, for models with > 100 iterations and >10 model cells, we see performance gains which become substantial as the number of iterations/grid sizes grows (>14x improvement at best). Additional memory management improvements will help address minor slowdowns for single-cell models.