-
Notifications
You must be signed in to change notification settings - Fork 118
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
kschan: use eigen instead of sparse13 #2489
base: master
Are you sure you want to change the base?
Conversation
4497517
to
7870b75
Compare
✔️ 7870b75 -> Azure artifacts URL |
✔️ 7870b75 -> Azure artifacts URL |
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.
Nice. I suppose, eventually, this strategy can be used to eliminate sparse13 entirely. We'll just want to verify that performance is equal or better.
7870b75
to
083e0b3
Compare
083e0b3
to
ca688b0
Compare
✔️ ca688b0 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ 8a05c9e -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@nrnhines results changed... again. |
✔️ 72f7558 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
2c8802c
to
c89180f
Compare
c89180f
to
8eab595
Compare
✔️ e5dca68 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
@nrnhines if you have some time to look at the difference in result of this PR, I can have a call with you to give you more explanation of the code. |
✔️ 531c252 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ 72b7cdc -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ baaf458 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ 9f21585 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
At the moment, this only appears from
Have you ever seen the CI error on your machine? If so, what cmake did you use.
|
Quality Gate passedIssues Measures |
✔️ 03ab16f -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
✔️ 8dc1cf4 -> Azure artifacts URL |
This comment has been minimized.
This comment has been minimized.
Quality Gate passedIssues Measures |
break; | ||
case Eigen::InvalidInput: | ||
hoc_execerror("InvalidInput: the inputs are invliad", nullptr); | ||
break; |
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 default clause might be nice in case it's not exhaustive.
@@ -468,7 +468,8 @@ class KSChan { | |||
int cvode_ieq_; | |||
Symbol* mechsym_; // the top level symbol (insert sym or new sym) | |||
Symbol* rlsym_; // symbol with the range list (= mechsym_ when density) | |||
char* mat_; | |||
Eigen::SparseMatrix<double> mat_{}; | |||
Eigen::SparseLU<Eigen::SparseMatrix<double>> lu_{}; | |||
double** elms_; | |||
double** diag_; |
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.
are these two still needed or can the be removed?
✔️ 91941dd -> Azure artifacts URL |
kschan
is using asparse13
matrix to<fill the blank>
, we replace it with aEigen::SparseMatrix
.During the process we remove variables
elms_
anddiag_
.diag_
was a list of all diagonal value accessed by direct raw pointers,elms_
were the useful values of the matrix store as direct raw pointers to internal of the matrix too.We needed to remove it, because, with
Eigen
, the matrix can be relocated and so the pointers be invalidate.A second change is to store the matrix as a value inside the class instead of a pointer.
We should have take care about the fact that
sparse13
matrix are 1-indexed andEigen
is 0-indexed.Last, we store the solver along the matrix
Eigen::SparseLU
. This is a sparse solver using the LU decomposition.