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

Rxd sourcevar #1549

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Rxd sourcevar #1549

wants to merge 5 commits into from

Conversation

nrnhines
Copy link
Member

@nrnhines nrnhines commented Nov 30, 2021

A temporary work around to allow rxd variables to be referenced in ParallelContext.source_var without raising an error due to being unable to update the pointer. This relies on the rxd variable to have a stable location from the time it was referenced by source_var throughout its usage in simulation. This must remain a work in progress until a way to check for rxd pointer validity/updating has been developed. While this code presently turns off checking of source_var pointers that are not explicitly associated with a Section, it cannot be merged to the master.

See #1523

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
The assumption is that the pointer is stable.
@nrnhines nrnhines requested a review from ramcdougal November 30, 2021 16:00
@nrnhines nrnhines marked this pull request as draft November 30, 2021 16:00
@pramodk
Copy link
Member

pramodk commented Feb 28, 2022

(Just a note - this is WIP and won't be merged soon / for 8.1 release.)

@ramcdougal
Copy link
Member

When would we need to update a pointer? And where is the code that attempts to do this.

One scenario:

If we have a 1D simulation and nseg changes, then the pointers may change.

@nrnhines
Copy link
Member Author

@ramcdougal If the model has not changed, then the only time pointers need updating is after cvode.cache_efficient(1) takes effect. If the model changes, and cvode.cache_efficient(1) is in effect, then just about any pointer to a RANGE variable may become invalid and need updating because cache efficiency after a model changes generally means throwing away the old cache efficient memory and reallocating a new cache efficient structure. Generally, pointers can be updated if they have semantics in the sense of enough context to know what the old pointer was pointing to, e.g. cell.section(x).mechanism.var[index] .

A recent test example for CoreNEURON was introduced in #1622. See test/coreneuron/test_pointer.py . To set the original POINTERs in the mod file when the Model is instantiated, the method update_pointers(self) is called. That also is registered so that it is called back when cache_efficient forces an update with

       self._callback_setup = h.PtrVector(1)
       self._callback_setup.ptr_update_callback(self.update_pointers)

@ramcdougal
Copy link
Member

Did #2027 attempt to do anything about rxd memory?

@bbpbuildbot

This comment has been minimized.

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.

None yet

4 participants