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

refactor get_influx for performance #1753

Merged
merged 3 commits into from
Aug 27, 2024
Merged

refactor get_influx for performance #1753

merged 3 commits into from
Aug 27, 2024

Conversation

SouthEndMusic
Copy link
Collaborator

@SouthEndMusic SouthEndMusic commented Aug 22, 2024

This is a follow-up of #1606.

Hopefully fixes the runtime of the HWS model.

@SouthEndMusic SouthEndMusic changed the title refactor get_influx for performance refactor get_influx for performance Aug 22, 2024
@SouthEndMusic
Copy link
Collaborator Author

Without this PR:

image

With this PR:

image

@SouthEndMusic
Copy link
Collaborator Author

SouthEndMusic commented Aug 22, 2024

It does look like the HWS model is still quite a bit slower than before. That can be due to a few things:

  • The Jacobian sparsity is wrong
  • The extra water_balance! call for flow integration
  • The modification to ManningResistance

vertical_flux[n + basin_idx] + # evaporation
vertical_flux[2n + basin_idx] - # drainage
vertical_flux[3n + basin_idx] # infiltration
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the keyword return? So it makes the function more clear

@SouthEndMusic SouthEndMusic merged commit d8fe0a1 into main Aug 27, 2024
21 of 27 checks passed
@SouthEndMusic SouthEndMusic deleted the speed_up_hws branch August 27, 2024 09:59
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

Successfully merging this pull request may close these issues.

2 participants