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

nonlinz.cpp: use eigen instead of sparse13 #2623

Merged
merged 20 commits into from
Jan 16, 2024
Merged

Conversation

alkino
Copy link
Member

@alkino alkino commented Nov 30, 2023

  • diag_ have been removed. Those was pointer for direct access to the diagonal elements, but Eigen can relocate matrix and invalidate pointers.
  • double* rv_ (real v_) and double* jv_ (imag v_), have been changed to std::vector<double> v_.
  • char* m_ (the sparse13 matrix) have been changed to a Eigen::SparseMatrix<std::complex<double>> m_. The solver Eigen::SparseLU lu_ have been added. One of the main difference is that sparse13 is 1-indexed and Eigen: 0-indexed.
  • The whole complex version of sparse13 have been removed because this was the last use.
  • transfer_amp, input_amp, transfer_phase, input_phase and ratio_amp have all been simplified by using standard functions of std::complex instead of computing by ourself.
  • v_index have been removed because this was a vector i -> i + 1. Now that Eigen is 0-indexed it becomes really useless.
  • In the file partrans.cpp the function pargag_jacob_rhs has been modified to support std::complex<double>, so know we do only one call of the function (before one with real and one with complex part), but inside we loop twice on real and complex because the algorithm is hard to understand to do everything in once.

Copy link

✔️ f71b138 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ ba6cb29 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 62b1507 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 01a2dfc -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 12b8d64 -> Azure artifacts URL

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (45cdea7) 66.18% compared to head (5f3bf6d) 66.19%.

Files Patch % Lines
src/nrniv/nonlinz.cpp 55.84% 34 Missing ⚠️
src/nrniv/partrans.cpp 96.29% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2623   +/-   ##
=======================================
  Coverage   66.18%   66.19%           
=======================================
  Files         559      559           
  Lines      108940   108880   -60     
=======================================
- Hits        72107    72070   -37     
+ Misses      36833    36810   -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ beaacfa -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Dec 7, 2023

NEURON ModelDB CI: launching for beaacfa via its drop url

Copy link

✔️ 5130833 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link
Contributor

NEURON ModelDB CI: launching for a8f33b3 via its drop url

@bbpbuildbot

This comment has been minimized.

Copy link
Member

@iomaganaris iomaganaris left a comment

Choose a reason for hiding this comment

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

LGTM in general and has reasonable changes. Some small suggestions only. I must say that I'm not familiar with sparse13 and Eigen though. For the validity of the changes I would refer to the modeldbci

src/nrniv/partrans.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Outdated Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.h Outdated Show resolved Hide resolved
src/nrniv/nonlinz.cpp Outdated Show resolved Hide resolved
Copy link

✔️ bc5c51c -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link
Member

@ohm314 ohm314 left a comment

Choose a reason for hiding this comment

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

Overall really good changes, but I do have a few questions and requests :)

src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Outdated Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Outdated Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/nonlinz.cpp Show resolved Hide resolved
src/nrniv/partrans.cpp Show resolved Hide resolved
Copy link

✔️ 27af30a -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@alkino alkino marked this pull request as draft December 19, 2023 14:13
@bbpbuildbot

This comment has been minimized.

@alkino alkino linked an issue Dec 30, 2023 that may be closed by this pull request
@alkino alkino marked this pull request as ready for review January 15, 2024 21:42
Copy link

sonarcloud bot commented Jan 15, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

✔️ 5f3bf6d -> Azure artifacts URL

@pramodk pramodk requested a review from ohm314 January 16, 2024 07:24
Copy link
Member

@ohm314 ohm314 left a comment

Choose a reason for hiding this comment

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

looks good!

@1uc 1uc removed their request for review January 16, 2024 14:01
@alkino alkino merged commit d6b9955 into master Jan 16, 2024
37 checks passed
@alkino alkino deleted the cornu/sparse13_nrnlinz branch January 16, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite nonlinz to use std::complex instead of 2 vectors
6 participants