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

[SofaBaseLinearSolver] Make CRSMultiMatrixAccessor optional (compilation and usage) #2372

Merged
merged 2 commits into from Oct 8, 2021

Conversation

fredroy
Copy link
Contributor

@fredroy fredroy commented Sep 30, 2021

CRSMultiMatrixAccessor was isolated in #2220 and was make compilable by default.
The only case where it could be used is in MatrixLinearSolver by defining a macro (SOFA_SUPPORT_CRS_MATRIX), but this one was never defined so effectively the CRSMultiMatrixAccessor was never used (even if compiled)

Thing is, CRSMultiMatrixAccessor takes a loooong time to compile (and takes heap of memory).
The reason is that it needs to compile (6 * 6 * 6 * 2 * 2) * 2 = 1728 functions because of chains of template. (EDIT actually it is even more than that: (6 + (6*6) + (6*6*6) + (6*6*6*2) + (6*6*6*2*2)) * 2 = 3108)

So in the end, either you want to compile it and use it, or dont use it but dont compile it...
A cmake (advanced) option is introduced for people who really wish to use it.
By the way CRSMultiMatrixAccessor code quality is very dubious (const_cast<> everywhere...),
and the english comments are.... special

For the sake of it, std::cout calls have been replaced with msg_info() as well.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: clean Cleaning the code pr: status to review To notify reviewers to review this pull-request labels Sep 30, 2021
@fredroy
Copy link
Contributor Author

fredroy commented Oct 5, 2021

[ci-build][with-all-tests]

Copy link
Contributor

@alxbilger alxbilger left a comment

Choose a reason for hiding this comment

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

CRSMultiMatrixAccessor is condemned. Its days are counted...

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Oct 6, 2021
@fredroy fredroy added pr: status wip Development in the pull-request is still in progress and removed pr: status ready Approved a pull-request, ready to be squashed labels Oct 6, 2021
@fredroy fredroy added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Oct 6, 2021
@fredroy
Copy link
Contributor Author

fredroy commented Oct 6, 2021

[ci-build][with-all-tests]

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Oct 8, 2021
@hugtalbot hugtalbot merged commit b3d5f6b into sofa-framework:master Oct 8, 2021
@fredroy fredroy deleted the option_crsmma branch October 14, 2021 09:41
@guparan guparan added this to the v21.12 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean Cleaning the code pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants