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

Change LU decomposition class to be Doolittle-specific #683

Merged
merged 7 commits into from
Nov 11, 2024

Conversation

sjsprecious
Copy link
Collaborator

This PR renames the LU decomposition class to Doolittle, which is the specific implementation for LU decomposition in MICM.

fix #682

@sjsprecious sjsprecious self-assigned this Nov 8, 2024
@sjsprecious sjsprecious added the enhancement New feature or request label Nov 8, 2024
@sjsprecious sjsprecious added this to the MICM Paper milestone Nov 8, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.19%. Comparing base (3f0c607) to head (b0ca55d).

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.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@K20shores K20shores left a 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<
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using JitSolverBuilder_Doolittle = SolverBuilder<
using DefaultJITSolverBuilder = SolverBuilder<

I prefer this instead of adding doolittle to the name. What do you think?

Copy link
Collaborator Author

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?

Copy link
Collaborator

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

Copy link
Collaborator Author

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?

Copy link
Collaborator

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

Copy link
Collaborator Author

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<
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using CudaSolverBuilder_Doolittle = SolverBuilder<
using DefaultCUDASolverBuilder = SolverBuilder<

I prefer this instead of adding doolittle to the name. What do you think?

Copy link
Collaborator Author

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.

@@ -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_)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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?

Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

@mattldawson mattldawson left a 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

@@ -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_)
Copy link
Collaborator

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

@@ -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>>>;
Copy link
Collaborator

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<
Copy link
Collaborator

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

@sjsprecious
Copy link
Collaborator Author

Thanks @mattldawson . I just revert the builder to use its original name as suggested.

Copy link
Collaborator

@mattldawson mattldawson left a comment

Choose a reason for hiding this comment

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

nice!

@sjsprecious sjsprecious merged commit 21a6d64 into main Nov 11, 2024
29 checks passed
@sjsprecious sjsprecious deleted the rename_lu_decomp_class branch November 11, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename LU decomposition
4 participants