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

Fix implicit argument handling#1325

Merged
JCGoran merged 6 commits into
masterfrom
jelic/fix_implicit_arg
Jun 27, 2024
Merged

Fix implicit argument handling#1325
JCGoran merged 6 commits into
masterfrom
jelic/fix_implicit_arg

Conversation

@JCGoran

@JCGoran JCGoran commented Jun 17, 2024

Copy link
Copy Markdown
Contributor

at_time, an internal NEURON function, requires an instance of NrnThread*, which is implicit in the mod file, but was previously called with a non-existing argument name (parent function had NrnThread* _nt, while the call to at_time had passed nt).

Note that I am slightly annoyed at the possible fixes here: in NEURON codegen, all of the arguments passed to functions apparently start with an underscore, while for coreNEURON codegen all of them start without an underscore.
This suggests a couple of possible fixes:

  • make NEURON generate nt instead of _nt (this PR)
  • make coreNEURON generate _nt instead of nt (requires a bit more work since the unit tests check the codegen directly)
  • refactor ImplicitArgumentVisitor (or make another one, or add a function in the codegen) which correctly sets the right variable (either with or without an underscore) depending on the the code backend used for the codegen
  • ??? (your proposal here)

Goran Jelic-Cizmek added 2 commits June 17, 2024 16:28
`at_time` requires an instance of `NrnThread*`, which is implicit in the
mod file.
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Jun 17, 2024
@codecov

codecov Bot commented Jun 17, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 85.37%. Comparing base (c8d0833) to head (e740c87).

Files Patch % Lines
src/codegen/codegen_neuron_cpp_visitor.cpp 50.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1325   +/-   ##
=======================================
  Coverage   85.37%   85.37%           
=======================================
  Files         178      178           
  Lines       13458    13458           
=======================================
  Hits        11490    11490           
  Misses       1968     1968           

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

@bbpbuildbot

This comment has been minimized.

@JCGoran JCGoran requested review from 1uc and pramodk and removed request for 1uc June 18, 2024 07:24
Comment thread test/usecases/implicit_argument/cacur.mod Outdated
Comment thread test/usecases/implicit_argument/simulate.py Outdated
Comment thread test/usecases/implicit_argument/simulate.py Outdated
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Jun 18, 2024
@bbpbuildbot

This comment has been minimized.

@1uc

1uc commented Jun 19, 2024

Copy link
Copy Markdown
Collaborator

Please check how widely _nt is used in VERBATIM code. Then we can decide if switching to nt is a good idea.

@JCGoran

JCGoran commented Jun 19, 2024

Copy link
Copy Markdown
Contributor Author

@1uc let's just say the answer is "non-zero". Can we change coreNEURON codegen instead then (i.e. use option 2 from the description)?

@1uc

1uc commented Jun 19, 2024

Copy link
Copy Markdown
Collaborator

You might want to check neurodamus-models before changing the tests, BBP has written MOD files that consist mostly of VERBATIM blocks. I assume they work with CoreNEURON (and NEURON). Therefore, there's a good chance that they use both _nt and nt depending on which simulator is targeted.

@JCGoran

JCGoran commented Jun 19, 2024

Copy link
Copy Markdown
Contributor Author

Using both grep -RiIl 'verbatim' | xargs grep '\<_nt\>' and directly grep -RiI '\<nt\>' reveals no matches in neurodamus-models; any other repos that could potentially be problematic? Otherwise, if there's too many things that could potentially break, I'll go back to the drawing board.

@JCGoran JCGoran requested a review from 1uc June 20, 2024 14:15
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Jun 20, 2024
@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #218158 (:white_check_mark:) have been uploaded here!

Status and direct links:

@JCGoran JCGoran merged commit 7beaee9 into master Jun 27, 2024
@JCGoran JCGoran deleted the jelic/fix_implicit_arg branch June 27, 2024 08:09
JCGoran added a commit to neuronsimulator/nrn that referenced this pull request Mar 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants