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

Dev numba #226

Closed
wants to merge 9 commits into from
Closed

Dev numba #226

wants to merge 9 commits into from

Conversation

dlohmeier
Copy link
Collaborator

I would like to suggest some changes to the pipeflow procedure:

  • All derivatives (for now only implemented in hydraulic calculations) are calculated globally, i.e. the branch component's calculate_derivatives_hydraulic is moved outside that class, as this behaviour is always the same.
  • It is possible to define your own additional procedures for updating the pit before and after derivative calculation. This is helpful for instance in case of pressure lift recalculation or for branch components whose pressure difference does not depend on the flow.
  • I implemented some parts in numba which should accelerate the pipeflow calculation in most cases.

Numba does have downsides that should be discussed:

  • It is very hard to debug numba code.
  • Compilation takes time, which leads to the fact that in case of just one pipeflow for a small network, this solution is even slower. This can be seen from the test timing, which will be slower with the numba implementations. The larger the dataset and the more times the function is called, the larger the benefit.
  • It might be more difficult to guarantee a smooth run on all types of machines (although the numba developers really try to make it work anywhere).

- calculate_derivatives_hydraulic applied to whole branch_pit
- before and after that each component can update the branch_pit
- most parts of calculate_derivatives_hydraulic and lambda calculation implemented in numba
@dlohmeier
Copy link
Collaborator Author

This is also a suggestion to handle issue #199.

@dlohmeier dlohmeier closed this Feb 3, 2021
@dlohmeier
Copy link
Collaborator Author

I will create a new branch for further development.

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.

1 participant