Optimization for PETSc preallocation#345
Merged
mohd-afeef-badri merged 13 commits intoarcaneframework:mainfrom Jan 6, 2026
Merged
Optimization for PETSc preallocation#345mohd-afeef-badri merged 13 commits intoarcaneframework:mainfrom
mohd-afeef-badri merged 13 commits intoarcaneframework:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
==========================================
+ Coverage 69.44% 69.48% +0.04%
==========================================
Files 118 118
Lines 14614 14695 +81
Branches 1975 1983 +8
==========================================
+ Hits 10148 10211 +63
- Misses 4011 4028 +17
- Partials 455 456 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…atrix_values attributes in DoFLinearSystemImplBase class
…ent constant sparsity
mohd-afeef-badri
requested changes
Dec 23, 2025
| // noop | ||
| } | ||
|
|
||
| bool isMatrixSparsityConstant() const override |
Collaborator
There was a problem hiding this comment.
check my comments above.
Contributor
Author
There was a problem hiding this comment.
This function is called in the [testlab]direct-solver test. I put a noop because the SequentialDoFLinearSystemImpl class does not have the constant sparsity and values attributes.
modules/testlab/FemModule.cc
Outdated
Comment on lines
2058
to
2060
| Real end = platform::getRealTime(); | ||
|
|
||
| info() << "TIME TAKEN: " << end - start; |
modules/testlab/FemModule.cc
Outdated
| ITimeStats* tstat = m_time_stats; | ||
| Timer::Action timer_action(tstat, "Solving"); | ||
|
|
||
| Real start = platform::getRealTime(); |
grospelliergilles
requested changes
Dec 23, 2025
Comment on lines
336
to
340
| void setConstantMatrixSparsity(bool val); | ||
| void setConstantMatrixValues(bool val); | ||
| bool isMatrixSparsityConstant(); | ||
| bool isMatrixValuesConstant(); | ||
|
|
Member
There was a problem hiding this comment.
Please add documentation for these methods.
grospelliergilles
approved these changes
Jan 5, 2026
mohd-afeef-badri
approved these changes
Jan 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preallocate the matrix shape (nnz) only one time.
At each call to solve, the matrix will be filled with new values but the same shape.
At the destruction of the
PETScDoFLinearSystemImplobject, all PETSc object will be freed. This include the matrix, the KSP solver and the Local2Global map indices.Vectors are still allocated and freed at each call to solve.