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

Lanczos tests #132

Closed
wants to merge 3 commits into from
Closed

Lanczos tests #132

wants to merge 3 commits into from

Conversation

aprokop
Copy link
Collaborator

@aprokop aprokop commented Feb 18, 2019

No description provided.

Adding a stupid check to try to not overreach for eigenvalues. Seem to
somewhat work, but completely unclear how robust it is.
@ghost ghost assigned aprokop Feb 18, 2019
@ghost ghost added the in progress label Feb 18, 2019
@@ -192,7 +192,8 @@ AMGe_host<dim, MeshEvaluator, VectorType>::compute_local_eigenvectors(
{
boost::property_tree::ptree lanczos_params;
lanczos_params.put("num_eigenpairs", n_eigenvectors);
lanczos_params.put("tolerance", tolerance);
// lanczos_params.put("tolerance", tolerance);
lanczos_params.put("tolerance", 1e-6);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to commit that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but this is all in progress. I need to put a lot more comments about why I'm doing things this way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do so.

// pcout << "Grid complexity : " << hierarchy.grid_complexity() <<
// std::endl; pcout << "Operator complexity: " <<
// hierarchy.operator_complexity()
// << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove do not comment it out.

What is the rational for having/not having these print to the standard output?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check with @Rombur. I don't have an opinion on this and I am not sure why it was here in the 1st place.

std::map<std::tuple<std::string, bool, std::string, std::string, bool>,
double>
ref_solution;
// clang-format off
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability: Good call !

tt::tolerance(1e-6));
// (geometry, distortion, reordering, eigensolver, matrix-free)
std::map<std::tuple<std::string, bool, std::string, std::string, bool>,
double>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability: I would prefer a string or a scoped enumeration to denote matrix-free mode.

ref_solution[std::make_tuple("hyper_ball" , true , "None" , "lanczos" , false)] = 0.0966058675;
ref_solution[std::make_tuple("hyper_ball" , true , "None" , "lanczos" , true)] = 0.2982453175;
ref_solution[std::make_tuple("hyper_ball" , true , "Reverse Cuthill_McKee" , "lanczos" , false)] = 0.0966058675;
ref_solution[std::make_tuple("hyper_ball" , true , "Reverse Cuthill_McKee" , "lanczos" , true)] = 0.2982453175;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR
Would you confirm that you did add convergences rates for Lanczos and that nothing else change? Can you comment on the new gold values? Are they reasonably close to their LAPACK's counterpart?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The values are really close but not sure how robust the thing is. Lanczos test now fails, so I may need to play around with things. The whole thing is annoying, but proper fix is unclear.

BOOST_TEST(
conv_rate ==
ref_solution[std::make_tuple(mesh, distort_random, reordering)],
tt::tolerance(1e-6));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment here? Did we have if (mesh is hyper cube) { expression; } else { same expression; }?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@@ -334,6 +340,6 @@ BOOST_AUTO_TEST_CASE(weight_sum, *utf::tolerance(1e-4))
e[i] = 1.;
e.compress(::dealii::VectorOperation::insert);
restrictor_matrix.vmult(ee, e);
BOOST_TEST(ee.l1_norm() == 1.);
BOOST_TEST(ee.l1_norm() == 1., tt::tolerance(1e-4));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rational for having the floating point comparison manipulation in the BOOST_TEST macro versus having a decorator for the unit test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure that BOOST_AUTO_TEST_CASE and BOOST_DATA_TEST_CASE behave the same way, and was too lazy to google. So just replaced with what I know.

@@ -79,6 +79,9 @@ void matrix_market_output_file(
const std::string &filename,
const dealii::TrilinosWrappers::SparseMatrix &matrix);

void matrix_market_output_file(const std::string &filename,
const dealii::SparseMatrix<double> &matrix);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please comment on how this gets called with the changes you propose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not, should have been a separate PR for that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove from that PR.

@dalg24
Copy link
Collaborator

dalg24 commented Feb 18, 2019

Related to #115 and #114 (comment)

@aprokop aprokop mentioned this pull request Feb 21, 2019
@aprokop
Copy link
Collaborator Author

aprokop commented Feb 21, 2019

Superseded by #136.

@aprokop aprokop closed this Feb 21, 2019
@aprokop aprokop deleted the lanczos_tests branch February 21, 2019 17:01
@ghost ghost removed the in progress label Feb 21, 2019
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.

2 participants