Set pointer when using mod file that defines pointer
Posted: Fri Nov 20, 2015 11:40 am
This is just an FYI - my code was erroring out during a call to fcurrent() (as part of the call from finitialize() during the init procedure). It was reporting a segmentation violation and it took me awhile to realize it was due to the use of a mechanism (mod file) that defined and used a couple of pointers in its BREAKPOINT block, where I was only interested in using (and therefore only setting) one pointer. When a mechanism from a mod file is referenced in NEURON code, all pointers used (ie, on the right side of an equation) in the mod file must be set in the NEURON code. In retrospect, this is super obvious but I'm still adding an FYI post to save others a few minutes if they make this same mistake.
(I don't want to remove the pointer from the mechanism as it will certainly be used in other slight variations of the model.)
Code: Select all
pointerplaceholder = 0 setpointer mymech.unusedpointer, pointerplaceholder