-
Notifications
You must be signed in to change notification settings - Fork 162
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
Fix the FormSum
memory leak
#3897
Conversation
|
|
Oh dear, if this fixes the issue then that interface could do with updating! I think that the traversal method is taking advantage of the behaviour described here: #3348 (comment) This behaviour is not widely known and is quite unintuitive - it's usually considered a bug. It might be best to change this method signature (and the preorder traversal method) to use |
No. This does not fix it. I am still debugging. |
Shame it wasn't so simple! It may still be good to change the signatures to avoid that behaviour though |
I see. I gonna try |
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.
Looks good, just a couple of small suggestions on the code.
It would be good to have a test for the axpy methods too!
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.
Thanks! I would also like to see some tests. Including for the failure conditions like mismatching dats. These tests could go in https://github.com/firedrakeproject/firedrake/blob/master/tests/pyop2/test_dats.py (which contains some examples you could work off)
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.
Just docstring nitpicks from me. Looks fine otherwise. Thanks!
Co-authored-by: Connor Ward <[email protected]>
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.
Looks good to me, thanks @Ig-dolci!
Description
We are having memory leaks and more expensive computation of solvers involving
FormSum
(See more details on this discussion). That is caused by the sum operation involvingdat
. My solution here is to make a sum operation through the numpy arrays. Below is a comparison (using the example added at the discussion) of time and memory computation differences between the master branch and the current PR.