Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

CVODE codgen for NEURON#1399

Closed
JCGoran wants to merge 50 commits into
masterfrom
jelic/cvode_codegen
Closed

CVODE codgen for NEURON#1399
JCGoran wants to merge 50 commits into
masterfrom
jelic/cvode_codegen

Conversation

@JCGoran

@JCGoran JCGoran commented Aug 13, 2024

Copy link
Copy Markdown
Contributor

The implementation works as follows:

  • find any DERIVATIVE blocks, and copy them into DERIVATIVE_ORIGINAL_FUNCTION and DERIVATIVE_ORIGINAL_JACOBIAN. This is done since the cnexp (and some other visitors) solve the ODEs in-place, so the information about f(x) (and consequently its Jacobian) is lost. Why two new constructs instead of one? Because NMODL cannot insert two identical blocks (it doesn't matter if they have a different name) in the symbol table
  • DERIVATIVE_ORIGINAL_FUNCTION basically replaces x' = f(x) with Dx = f(x), while DERIVATIVE_ORIGINAL_JACOBIAN replaces x' = f(x) with Dx = Dx / (1 - dt * J(f)), where J is the Jacobian of the transformation (computed analytically using SymPy)

TODO:

  • add tests for KINETIC
  • fix issue with CONSERVE statement

@JCGoran JCGoran added the NEURON codegen Work toward NEURON code generation label Aug 13, 2024
@codecov

codecov Bot commented Aug 13, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 13.58025% with 70 lines in your changes missing coverage. Please review.

Project coverage is 86.22%. Comparing base (9ee3226) to head (9d09481).

Files Patch % Lines
src/codegen/codegen_neuron_cpp_visitor.cpp 13.58% 70 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1399      +/-   ##
==========================================
- Coverage   86.65%   86.22%   -0.44%     
==========================================
  Files         182      182              
  Lines       13626    13704      +78     
==========================================
+ Hits        11808    11816       +8     
- Misses       1818     1888      +70     

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

@JCGoran JCGoran force-pushed the jelic/cvode_codegen branch 2 times, most recently from 0f3872e to 1eb8294 Compare August 15, 2024 14:38
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Aug 15, 2024
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Aug 26, 2024
Goran Jelic-Cizmek added 7 commits August 26, 2024 14:41
@JCGoran JCGoran force-pushed the jelic/cvode_codegen branch from 1eee28e to 9d09481 Compare August 26, 2024 12:42
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Aug 26, 2024
@bbpbuildbot

This comment has been minimized.

bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Aug 30, 2024
@bbpbuildbot

This comment has been minimized.

@JCGoran JCGoran force-pushed the jelic/cvode_codegen branch from 5137d2c to fc63a84 Compare September 3, 2024 10:48
@bbpbuildbot

This comment has been minimized.

Goran Jelic-Cizmek added 7 commits September 10, 2024 11:27
Information about the original form of the ODE system is irretrievably
lost once the `SympySolverVisitor` or `NeuronSolveVisitor` run, so the
solution is just to copy them over in some unused block right before we
call those.
Still need to correct the codegen
@JCGoran JCGoran force-pushed the jelic/cvode_codegen branch from f2617b4 to 96a63fd Compare September 10, 2024 09:27
@JCGoran

JCGoran commented Oct 28, 2024

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1493

@JCGoran JCGoran closed this Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

NEURON codegen Work toward NEURON code generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants