-
Notifications
You must be signed in to change notification settings - Fork 250
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
[EigenSolvers] Add FEAST with MKL support to EigenSolversApplication #6482
Conversation
For the eigenvalue solver I have also tried FEAST. It turned out that (at least the version in MKL) is very sensitive to the choice of parameters. Especially the the search range was problematic. Do you also have this problem? |
I also experienced this, but would not call it a problem. I like the feature, that you can limit your eigenvales to a specific range very much and this is also important for some methods I am using. The only parameter that can really influence your results is the subspace size, but there is a functionality in FEAST which estimates a suitable size. It would be no big problem to expose this also in Kratos, e.g. as a process or a InitializeSolutionStep. In the new FEAST 4, you can, however, also look for extremal eigenvalues, e.g. the lowest in your defined search interval, which would start at zero for structural problems. This is the same functionality as the EigensystemSolver, if I am not mistaken. Regarding Windows compilation, I managed to compile FEAST, but linking it with all required Fortran libraries is something that needs further investigation and currently I do not have enough time for this. I hope this is no showstopper here. I also discusses with @philbucher if we should include FEAST's source code in the repository, like it is done in ExternalSolversApplication. Then the compilation of the library can be switched on and off directly from the configure file. |
To me it would be ok adding the feast code into the repo How big is it? |
It was a problem because it was not possible to find a general setup to find the smallest eigenvalues for our benchmarks. The new functions are definitely an enrichment. About the fortran-stuff: AFAIK it is not so easy to integrate fortran in Windows with the default toolchain. But I think we can start the FEAST integration as an exclusive Linux feature. BTW: Is there any connection to Eigen? |
The only connection is MKL. And that I thought, EigenSolversApplication is an application for solving the eigenvalue problem :) |
Was not the intention of the application but with the MKL dependency it makes sense to but it here. |
@philbucher I added the FEAST library to external_libraries. It weighs 2.5mb and is licensed under BSD. Compilation can now be included by |
applications/EigenSolversApplication/custom_python/eigen_solvers_python_application.cpp
Outdated
Show resolved
Hide resolved
I created #6645 since I didn't want to pollute this branch I noticed that the tests Other than that this is ready, I will discuss it in the committee |
Thank you very much for the review. On my machine the tests run for around 0.7 seconds each (in release). This is because I have to copy each column of the eigenvector matrix to a new vector, as the ublas space (at least its Python interface) does not support matrix-matrix-multiplication. If it takes too long, I can adapt the tests. |
hm if it ok in the CI then I guess it is fine |
…ast-improvements Improvements for [EigenSolvers] Add FEAST with MKL support to EigenSolversApplication #6482
I would rather not in the scope of this PR. Another problem is, that it's a multiplication of sparse and dense matrices. I will change the matrix used in the test, if the CI complains.+ And regarding |
@KratosMultiphysics/technical-committee this PR adds the latest version of If you agree then we don't have to use meeting-time for this ;) |
you need to merge master, there are some conflicts |
the conflict should be resolved |
@KratosMultiphysics/technical-committee proposes the following IMPORTANT: by default, everything has to compile without BLAS (mkl, or any blas) and without fortran. This means that in the tests we CANNOT use anything depending on those features |
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.
@qaumann I think this is ready, please feel free to merge
I made a small comment but this can be a future PR
It would be also nice if you could do the following two things:
- Port the tests in StructuralMechanics that use the FEAST of the ExternalSolversApp to use the solvers of the EigenSolversApp?
- If that is done remove Feast from the ExternalSolversApp as requested by @KratosMultiphysics/technical-committee
Nice work overall and thanks for the patience 👍
template<> | ||
Parameters SettingsHelper<double>::GetDefaultParameters() | ||
{ | ||
return Parameters(R"({ |
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.
@qaumann I suggest you implement / clean up in a follow up PR
@philbucher Thanks again for the review and the comments, I will address them now. |
If the EigenSolversApplication is compiled with MKL support, FEAST can now also be included to solve generalized eigenvalue problems. With this FEAST interface, it is possible to find either the lowest or highest eigenvalues for real symmetric problems or some eigenvalues inside a specified range for real and complex symmetric problems. The support can also be extended to general matrices or polynomial problems, if required.
The interface to FEAST in EigenSolversApplication differs from the one in ExternalSolversApplication in the following points:
There is one small change in the core, which makes the Solve function for complex eigensystems available to Python.
Tests are provided and the readme is updated. I tested it on Linux and will also try to run it on Windows. This is still a draft, so tell me what you think. I am happy for suggestions.