Page 1 of 1

Access NMODL vars from HOC

Posted: Thu Feb 24, 2011 7:59 pm
by jackfolla
Hi all,
I want to access to the vars declared in a file.mod.

My file.mod is:

Code: Select all

NEURON {
        SUFFIX STDPE2
        POINT_PROCESS STDPE2
        RANGE tau1, tau2, e, i, d, p, dtau, ptau, thresh, wmax, wmin
        RANGE g, gbdel, gblen, gbint, gscale
        NONSPECIFIC_CURRENT i
}
..................
In my file.hoc I want to print a variable (eg. wmax)
So, I have in file.hoc print wmax_STDPE2.
But this produces an error: 2 nrniv: undefined variable wmax_STDPE2.


I would also like to know how to handle the printing of variables directly from the file file.mod, when I run my program in parallel version.
In hoc I manage the printing with

Code: Select all

for rank=0, pc.nhost-1 {
  if (pc.id==rank) print var
...
Can this be done, also in a file.mod? (maybe in a VERBATIM block?)

Thanks.

Re: Access NMODL vars from HOC

Posted: Thu Feb 24, 2011 11:04 pm
by ted
A mechanism can be a density mechanism or a point process. It cannot be both. Decide which you want STDPE2 to be, and use SUFFIX or POINT_PROCESS accordingly, but not both.
jackfolla wrote:I would also like to know how to handle the printing of variables directly from the file file.mod, when I run my program in parallel version.
Try inserting printf statements. Then try figuring out what the heck is happening.

I don't know what you're trying to do, but (1) printing directly from a mod file during parallel simulation is guaranteed to introduce a host of problems you're not going to want to deal with, and (2) almost certainly there is a better way to accomplish whatever your aim is. But go ahead if you like.