-
Notifications
You must be signed in to change notification settings - Fork 6
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
Change LU decomposition class to be Doolittle-specific #683
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #683 +/- ##
=======================================
Coverage 93.19% 93.19%
=======================================
Files 53 53
Lines 3586 3586
=======================================
Hits 3342 3342
Misses 244 244 ☔ View full report in Codecov by Sentry. |
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.
I have a preference for only adding doolittle to the LU decomposition class and either leaving the solver builder names alone or renaming them to Default*
. But I can be convinced either way
@@ -17,7 +17,7 @@ namespace micm | |||
/// | |||
/// JIT-compiled solvers only work with vector-ordered matrices | |||
template<class SolverParametersPolicy, std::size_t L = MICM_DEFAULT_VECTOR_SIZE> | |||
using JitSolverBuilder = SolverBuilder< | |||
using JitSolverBuilder_Doolittle = SolverBuilder< |
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.
using JitSolverBuilder_Doolittle = SolverBuilder< | |
using DefaultJITSolverBuilder = SolverBuilder< |
I prefer this instead of adding doolittle to the name. What do you think?
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.
Thanks Kyle. I do not like my current name change to the solver builder either. If I add the Default
prefix to the solver builder as you suggested, what would be the alternative name when we add the new LU decomposition implementation?
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.
If it's faster, maybe _Fast
? That'll at least indicate that something fancy is going on
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.
That sounds great. For consistency purpose, is it better to put both Default
and Fast
as prefix or suffix?
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.
Personally, I would just leave this as JitSolverBuilder
. If the MOZART algorithm is faster, but someone wants to use the Doolittle algorithm (for some reason), they can just specify all the template parameters for the solver builder themselves
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.
Thanks @mattldawson . I just revert to the original builder name and we can do what you suggest after we implement the MOZART algorithm.
@@ -21,7 +21,7 @@ namespace micm | |||
/// | |||
/// GPU solvers only work with vector-ordered matrices | |||
template<class SolverParametersPolicy, std::size_t L = MICM_DEFAULT_VECTOR_SIZE> | |||
using CudaSolverBuilder = SolverBuilder< | |||
using CudaSolverBuilder_Doolittle = SolverBuilder< |
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.
using CudaSolverBuilder_Doolittle = SolverBuilder< | |
using DefaultCUDASolverBuilder = SolverBuilder< |
I prefer this instead of adding doolittle to the name. What do you think?
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.
As Matt suggested, we may just keep the original name for now.
examples/example.cpp
Outdated
@@ -47,7 +47,7 @@ int main(const int argc, const char* argv[]) | |||
auto chemical_system = solver_params.system_; | |||
auto reactions = solver_params.processes_; | |||
|
|||
auto solver = CpuSolverBuilder<micm::RosenbrockSolverParameters>(solver_params.parameters_) | |||
auto solver = CpuSolverBuilder_DoolittleLU<micm::RosenbrockSolverParameters>(solver_params.parameters_) |
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.
auto solver = CpuSolverBuilder_DoolittleLU<micm::RosenbrockSolverParameters>(solver_params.parameters_) | |
auto solver = DefaultCPUSolverBuilder<micm::RosenbrockSolverParameters>(solver_params.parameters_) |
I prefer this instead of adding doolittle to the name. What do you think?
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.
agreed, or just leave it as CpuSolverBuilder
. If the MOZART LU algorithm is faster, we'll probably just use that in the examples and tutorials
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.
As Matt suggested, we may just keep the original name for now.
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.
looks good! Just a couple comments related to the alias names
examples/example.cpp
Outdated
@@ -47,7 +47,7 @@ int main(const int argc, const char* argv[]) | |||
auto chemical_system = solver_params.system_; | |||
auto reactions = solver_params.processes_; | |||
|
|||
auto solver = CpuSolverBuilder<micm::RosenbrockSolverParameters>(solver_params.parameters_) | |||
auto solver = CpuSolverBuilder_DoolittleLU<micm::RosenbrockSolverParameters>(solver_params.parameters_) |
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.
agreed, or just leave it as CpuSolverBuilder
. If the MOZART LU algorithm is faster, we'll probably just use that in the examples and tutorials
examples/profile_example.cpp
Outdated
@@ -34,7 +34,7 @@ namespace fs = std::filesystem; | |||
using namespace micm; | |||
|
|||
template<std::size_t L> | |||
using VectorBuilder = CpuSolverBuilder<RosenbrockSolverParameters, VectorMatrix<double, L>, SparseMatrix<double, SparseMatrixVectorOrdering<L>>>; | |||
using VectorBuilder = CpuSolverBuilder_DoolittleLU<RosenbrockSolverParameters, VectorMatrix<double, L>, SparseMatrix<double, SparseMatrixVectorOrdering<L>>>; |
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.
same as above
@@ -17,7 +17,7 @@ namespace micm | |||
/// | |||
/// JIT-compiled solvers only work with vector-ordered matrices | |||
template<class SolverParametersPolicy, std::size_t L = MICM_DEFAULT_VECTOR_SIZE> | |||
using JitSolverBuilder = SolverBuilder< | |||
using JitSolverBuilder_Doolittle = SolverBuilder< |
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.
Personally, I would just leave this as JitSolverBuilder
. If the MOZART algorithm is faster, but someone wants to use the Doolittle algorithm (for some reason), they can just specify all the template parameters for the solver builder themselves
Thanks @mattldawson . I just revert the builder to use its original name as suggested. |
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.
nice!
This PR renames the LU decomposition class to
Doolittle
, which is the specific implementation for LU decomposition in MICM.fix #682