-
Notifications
You must be signed in to change notification settings - Fork 2
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
add a LUSOL functionality test #164
Conversation
oh. this also adds comments referencing stuff about extracting L/U factors. i'll remove that so this can be focused only on testing |
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.
A good first stab. Here are some suggestions how to proceed.
@superwhiskers, I suggest you add fix for #162 to this PR. |
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.
There are some minor issues that I addressed in my comments.
Newly added expand()
function needs unit test(s). I suggest we create MatrixConversionTest.hpp
and runMatrixConversionTest.cpp
in tests/unit
directory and implement needed unit tests there.
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.
Good progress but some more fixes are needed before this is ready to merge. I left a few comments to that end.
LUSOL test produces some type conversion warnings that need to be fixed.
int matrix::Sparse::setValueOwnership(bool owns, memory::MemorySpace memspace) | ||
{ |
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.
It should be plural in the function name -- values.
int matrix::Sparse::setValueOwnership(bool owns, memory::MemorySpace memspace) | |
{ | |
int matrix::Sparse::setValuesOwnership(bool owns, memory::MemorySpace memspace) | |
{ |
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 don't really see how that's any better. setValueOwnership
is just as correct in a plural context
resolve/matrix/Utilities.hpp
Outdated
/** | ||
* @brief Expands a symmetric COO matrix stored only as a half to its full size | ||
*/ | ||
int expand(Coo&); | ||
|
||
/** | ||
* @brief Expands a symmetric CSR matrix stored only as a half to its full size | ||
*/ | ||
int expand(Csr&); | ||
|
||
/** | ||
* @brief Expands a symmetric CSC matrix stored only as a half to its full size | ||
*/ |
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.
One thing that is important to mention here and in source comments is if you assume that the matrix is stored as upper- or lower triangular.
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.
no assumption is made. technically, you could pass in a matrix that isn't triangular and it would still work
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 function should not allow that. If the matrix is not upper- or lower-triangular, this function should return an error. If for some reason non-symmetric matrix was tagged as symmetric, that is a nasty bug, which we need to protect against.
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.
it's specified as part of the preconditions for each of the expand functions. i can add a debug check that goes away in release builds to catch any bugs that violate it, but i don't see why this should be a general check we do, as the presence of a precondition makes it on the caller to know beforehand
TestOutcome cooMatrix5x5() | ||
{ | ||
TestStatus status; |
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.
Tests needs to be documented. Also, the test should not be specific to particular matrix size.
- implemented matvec over COO matrices - added back symmetric matrix expansion for COO matrices (temporary) - reworked integration test code from KLU into integration test code for LUSOL (in progress, does not fully work) - made minor tweaks to LinSolverDirectLUSOL - set data ownership at exit of matrix-from-file conversion to avoid data leaks - added a function to matrix::Sparse to set data ownership
- fix memory leak in `Csr` hijacking constructor - add hijacking constructor to `Coo` - remove needless use of `Sparse::setDataOwnership`/`Sparse::setValueOwnership` - move `Coo::expand` to a separate function in `Utilities.cpp` - add `Csr` expansion to `ReSolve::matrix::expand`
… on the stated value
7947a57
to
5e69253
Compare
rebased on latest |
https://github.com/ORNL/ReSolve/blob/lusol-integration-tests/examples/CMakeLists.txt#L140 - might be good to have Lusol be used in the consumer test for testing |
I agree. To get there, we need to get LUSOL to work within a refactorization solver strategy, which is outside the scope of this PR. |
Closing in favor of #189. |
this pull request adds a functionality test for LUSOL. there is one thing that needs to be worked out before this can actually be merged:
matrix::Coo
class which expands the matrix. this is not permanent and it should be fully expanded upon prior to a merge with equivalent functionality for other matrix types