-
Notifications
You must be signed in to change notification settings - Fork 362
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
BiCGStab and CG implementations: possible improvements #3587
Conversation
…s implemented in MLCGSolverT class.
|
||
MF sorig(ba, dm, ncomp, nghost, MFInfo(), factory); | ||
MF p (ba, dm, ncomp, nghost, MFInfo(), factory); | ||
MF r (ba, dm, ncomp, nghost, MFInfo(), factory); | ||
MF s (ba, dm, ncomp, nghost, MFInfo(), factory); |
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.
The variable s
can be eliminated by using residual r
@@ -225,7 +215,14 @@ MLCGSolverT<MF>::solve_bicgstab (MF& sol, const MF& rhs, RT eps_rel, RT eps_abs) | |||
{ | |||
ret = 4; break; | |||
} | |||
rho_1 = rho; |
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.
No need to save old rho as we only need rhTv to compute beta
@eebasso A number of regression tests have failed. Some of them were just roundoff errors, but some produced NaNs. https://ccse.lbl.gov/pub/GpuRegressionTesting/AMReX/2023-11-01-003/index.html If it makes sense, baybe you could split this into a few small PRs. |
I think splitting up into multiple PRs is quite reasonable. Shall I update this PR with a smaller change or close it and make a new PR ? |
It might be cleaner to start new PRs. |
Summary
Corrects some possible minor inefficiencies in the implementation of biconjugate gradient stabilized (BiCGStab) and conjugate gradient (CG) methods defined in MLCGSolverT class. The changes have not been tested yet. This should lead to no change in the outcomes, but hopefully will be faster by reducing memory usage and copy operations.
Additional background
See the attached pdf for a more in-depth explanation and comparison of current vs proposed
implementations. BiCGStab and CG algorithm summary.pdf
Checklist
The proposed changes: