-
Notifications
You must be signed in to change notification settings - Fork 91
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
refactor: Use matrix-matrix interface in LAPACK solve #3234
refactor: Use matrix-matrix interface in LAPACK solve #3234
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3234 +/- ##
===========================================
- Coverage 56.02% 56.01% -0.01%
===========================================
Files 1053 1053
Lines 89123 89115 -8
===========================================
- Hits 49927 49917 -10
- Misses 39196 39198 +2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
static bool solveLinearSystem( arraySlice2d< real64 const > const & A, | ||
arraySlice1d< real64 const > const & b, | ||
arraySlice1d< real64 > const & x ) | ||
static bool solveLinearSystem( arraySlice2d< real64, USD > const & A, |
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 personally preferred having the rhs
and the solution
into two separate arrays. I am guessing that this is the lapack interface though... We could keep the separation on the GEOS side though.
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.
The separate rhs
/solution
interface on BlasLapackLA
still exists. This change destroys the rhs but avoids having to allocate extra space for solution
and rhs
knowing that we are not going to need the rhs or the matrix after the solve.
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.
is the allocation the same? A single array2d
instead of 2 array1d
?
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.
My mistake. The allocation was on the matrix. With the previous interface, everytime we call the solve, additional space had to be allocated for the LU factors of the matrix. This way there is no extra space allocated since it's a single solve and the space allocated for the matrix is used for the LU factors (destroying the matrix but once we have solved we don't care anymore).
With the single column by column solve it would have been nice to factorize the matrix and then use the LU factors on each column but we don't have that interface. Instead I added an interface where you can do an in-place matrix-matrix solve.
* Use matrix interface * uncrustify * Remove unrelated changes * Remove unncessesary assignment --------- Co-authored-by: Matteo Cusini <49037133+CusiniM@users.noreply.github.com>
* Use matrix interface * uncrustify * Remove unrelated changes * Remove unncessesary assignment --------- Co-authored-by: Matteo Cusini <49037133+CusiniM@users.noreply.github.com>
This PR replaces multiple matrix-vector solves with a single matrix-matrix solve following PR3173. This also uses a version of the LAPACK call the destroys the coefficient matrix and rhs matrix to avoid further allocation in
BlasLapackLA
.