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

EXTERNAL can't refer to NEURON internals. #3165

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented Nov 1, 2024

The way NMODL generates code, we're unable to find a way to have EXTERNAL gbl_foo refer to global variables in other mod files and global variables inside nrn. The issue is that gbl in the mechanism foo isn't implemented as a global double. Instead they're all collected in an struct containing all the global variables (ease of GPU programming).

What makes this difficult is that we can't know if EXTERNAL gbl_foo should be split as {var_name}_{mech_name}. Therefore, we can't deduce which (if any) mechanism gbl belongs. With more help from the DSL we could implement it, e.g.:

EXTERNAL var_name FROM mech_name | "nrn"

The handful of cases I could find on ModelDB never used EXTERNAL to refer to global variables inside nrn, only global variables in other MOD files (under their control).

Therefore, I'd like to propose to remove this part of EXTERNAL. The feature would likely continue to work for NOCMODL, but wouldn't work for NMODL. The tests that check that it's possible to gain access to internal variables would be removed. A similar change was made in the past. When a global variable became a thread-variable, this test was changed to reflect the fact that thread variables can't be the target of an EXTERNAL. This particular example feels like, if it were essential to know the clamp_resist value, it could be handled via the mechanism used for other "NEURON globals" like celsius.

Copy link

sonarcloud bot commented Nov 1, 2024

Copy link

✔️ 938c3f2 -> Azure artifacts URL

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.10%. Comparing base (ebe3d3b) to head (938c3f2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3165      +/-   ##
==========================================
- Coverage   67.11%   67.10%   -0.01%     
==========================================
  Files         571      571              
  Lines      111318   111318              
==========================================
- Hits        74714    74705       -9     
- Misses      36604    36613       +9     

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

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.

2 participants