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

Debug for SYMGS+SPMV fusion #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaofengF
Copy link

@xiaofengF xiaofengF commented Dec 16, 2022

Previous implementation of SYMGS+SPMV was using x_old to calculate the spmv (L * old_x + (D+U) * new_x), It was totally wrong due to the expression is equal to the value of source (i.e., b). The mathematical proof is that the backward induction is exact (U+D)x’’+Lx’=b.

It can also be proved by the applied code: ComputeSYMGS.cpp:764-768
totalContribution += xv[row] * currentDiagonal; while xv[row]=(rv[row] - totalContribution)/currentDiagonal, which gives totalContribution =rv[row]

Now we ensure all x are new, and we calculate Ax by (L+D+U)x = b-Lx_pre+Lx to reuse the data calculated in forward sweep.

Previous implementation of SYMGS+SPMV was using x_old to calculate the spmv (L * old_x + (D+U) * new_x), It was totally wrong due to the expression is equal to the value of source (i.e., b). The mathematical proof is that the backward induction is exact (U+D)x’’+Lx’=b. 

Now we ensure all x are new, and we calculate Ax by (L+D+U)x = b-Lx_pre+Lx to reuse the data calculated in forward sweep.
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