-
Notifications
You must be signed in to change notification settings - Fork 100
Add diag sorting to Schwarz precond w/ l1 smoother #1939
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
base: develop
Are you sure you want to change the base?
Conversation
af8c930 to
9cc6d8f
Compare
|
I lowered the test tolerance for gko::half a bit |
191146a to
f32eb8c
Compare
| #include <cmath> | ||
| #include <memory> |
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.
Is it needed?
| l1_diag_csr->sort_by_column_index(); // spgeam requires sorting for | ||
| // some backends |
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.
Does it indeed solve the problems?
l1_diag should only contain the diagonal entry per row.
The column index should be perfectly sorted because of only one entry.
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.
ok, this totally makes sense... I'm not sure how I haven't noticed this, maybe I was just too overwhelmed trying to understand the preconditioner logic generally. I don't even know what the issue is about then, as I thought that it's described very clearly.
a8b7b4d to
49c0aba
Compare
yhmtsai
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.
the new test seems to be wrong.
Could you also check whether it is failed before fix?
The dist_mtx should already store the matrix in order.
You need to create the distributed matrix by hand first.
| .with_generated_preconditioner(this->local_solver_factory->generate( | ||
| gko::copy_and_convert_to<local_matrix_type>( | ||
| this->exec, non_dist_diag_with_l1))) |
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.
It is not the same matrix.
Schwarz L1 smoother adds the row absolute sum from non-local to diagonal of local matrix but it still keeps the off-diagonal matrix of local matrix.
| using cg = typename TestFixture::solver_type; | ||
| using prec = typename TestFixture::dist_prec_type; | ||
| using local_matrix_type = typename TestFixture::local_matrix_type; | ||
| constexpr double tolerance = 1e-20; |
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.
tolerance should adapt with valuetype. you can get it by r<T>::value
This PR is basically #1932 but without the sorting check. I've also added a test for a solver with the Schwarz preconditioner with L1 smoothing
Fixes: #1920