-
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
Make hh.mod
configure-able at compile-time
#3294
base: master
Are you sure you want to change the base?
Conversation
* introduce `NRN_SUPPORTED_KEYWORD` to differentiate whether the backend (NEURON or CoreNEURON) supports it * rename `hh.mod` to `hh.mod.in` * add `hh.mod` to .gitignore since it's still generated
Quality Gate passedIssues Measures |
✔️ fce18df -> Azure artifacts URL |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3294 +/- ##
=======================================
Coverage 67.07% 67.07%
=======================================
Files 571 571
Lines 111055 111055
=======================================
Hits 74487 74487
Misses 36568 36568 ☔ View full report in Codecov by Sentry. |
: `GLOBAL minf` will be replaced with `RANGE minf` if CoreNEURON enabled | ||
GLOBAL minf, hinf, ninf, mtau, htau, ntau | ||
: set at compile-time to `GLOBAL` if using NEURON, `RANGE` if using CoreNEURON | ||
@NRN_SUPPORTED_KEYWORD@ minf, hinf, ninf, mtau, htau, ntau |
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.
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.
"preference"
I don't know. This usage (exploiting GLOBAL for efficiency to effectively implement a multiple value return from a function) predates threads. And then, with a lot of internal shenanigans, promoting them to thread variables to avoid races. And then (for GPU) just replacing with RANGE when there are many many threads. The whole thing contradicts the desire for description instead of programming and we have been working around the problem ever since.
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.
@pramodk hence the "one way to fix" part 😅 Another option would be to move the mod files from src/nrnoc
to a subdir, like src/nrnoc/modfiles
, which has 2 additional subdirs, like neuron
and coreneuron
, and depending on whether CoreNEURON is used or not, we use the mod files from the corresponding subdir. The upside of that is that it avoids configure_file
magic (and wouldn't require yet another cmake variable, which are already hard to keep track of as it is), so all the mod files are still usable on their own. The backend-agnostic mod files could reside in modfiles/neuron
, with their modfiles/coreneuron
counterparts just being symlinks to those, while hh.mod
would need to have 2 versions, one for NEURON, and one for CoreNEURON.
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.
I've made an alternative implementation in #3295 if that one would be more appropriate.
This is one way to fix #3000. It basically makes
hh.mod
configure
-able by CMake, so we can decide at compile-time what to do with the file depending on whether or not we are using CoreNEURON.