-
Notifications
You must be signed in to change notification settings - Fork 237
Adding reference counting to ParCSRMatrix #1443
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
Conversation
|
Hi @oseikuffuor1 . I made a logic change to Would you please test out the mixed precision PCG cases to make sure this is working correctly? I have already run some of our standard regression tests and this looks good in the single precision case. If this looks okay, I will go ahead and make similar changes to the other Krylov solvers. Thanks! |
@rfalgout I just tested the mixed-precision PCG on the branch and it all looks good. Thanks. |
|
Hi @oseikuffuor1 and @liruipeng . There were some difficult-to-find memory leaks that I had to fix - ParCSRMatrixCreate is not the only routine that creates matrices, so I needed to set the reference counter there also. I have changed the handling of |
…ternal functions)
…ith Visual Studio
|
Hi @oseikuffuor1 and @liruipeng . Just following up on this PR. It's ready for final review. Thanks! |
| void *precond_data = (pcg_data -> precond_data); | ||
| // preconditioning matrix | ||
| void *precond_Mat = (pcg_data -> precond_Mat) ; | ||
| void *precond_Mat = (pcg_data -> precond_Mat) ; // preconditioning matrix |
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.
Should this comment be above the preceding line or did you intend to remove it?
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.
I just moved the comment to the end of the precond_Mat declaration line. I thought it looked better. :)
oseikuffuor1
left a comment
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 the me, thank you!
Hi @rfalgout . I guess when a parcsr matrix is not constructed using the constructor, we have to manually set the ref counter, such as in several places you did which makes sense. Just curious if we have covered all of these cases. |
liruipeng
left a comment
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 @rfalgout
I am pretty sure I covered all the cases. I did an appropriately-constructed grep for allocation of the matrix structure, and didn't find anything other than what's been fixed here. Thanks! |
|
Do we think this could grant a minor 3.0.1 release? |
Yes, I think we can do that. Stay tuned. |
StructandSStructmatrices, and this adds it toParCSRMatrix.src/krylov, reference counting would allow users to destroy the preconditioning matrix passed in through SetPrecondMatrix(). Add this later, and require the following instead.