Access NMODL vars from HOC

NMODL and the Channel Builder.
Post Reply
jackfolla
Posts: 48
Joined: Wed Jul 07, 2010 7:42 am

Access NMODL vars from HOC

Post 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.
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Access NMODL vars from HOC

Post 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.
Post Reply