http://www.neuron.yale.edu/neuron/install/install.html
This new standard distribution provides numerous improvements of performance for
model setup and simulation in general. Particularly noteworthy features include:
- New command line switches for nrngui or nrniv.
-h prints a summary of command line options
-c "statement" causes execution of the hoc command "statement" on startup - Simulations of large models now execute up to twice as fast as previously
because of improved cache efficiency. This continues to be an area of active
development. - On parallel hardware:
1. make -j will execute a distributed compilation of NEURON.
2. Individual cells can be distributed over multiple hosts for "multisplit"
simulations. This is useful for load balance when the number of cells is
small compared to the number of processes.
3. MPI barrier, allreduce, and allgather are now available from hoc.
4. SaveState has been upgraded to work with parallel simulations of networks. - A spike event queueing method called bin queue is now available which allows
faster execution of network simulations that use fixed time steps. - Python can be used as an alternative interpreter for NEURON, with convenient
and full access to all hoc built-in and user defined functions, procedures,
objects, strings, and values. Intensive development continues, so serious
Python developers will want to keep up to date with the latest alpha versions.
Anything evaluatable, assignable, or callable in hoc can also be done in Python.
Objects and values can be scalars or any dimensioned arrays.
All methods and fields of objects are accessible.
POINT_PROCESSes are objects and so all aspects are accessible.
Sections, both top level and within objects, are accessible via the object notation
implemented in the nrnpy_nrn.cpp file, and all segments, mechanisms, and range
variables are accessible via the object notation.
Basic Python usage
Code: Select all
import hoc
h = hoc.HocObject?() # accessibility to everything in hoc
h('obfunc newvec() { return new Vector($1) }') # execute any statement
v = h.newvec(5) # call any user defined function, v is now a hoc Vector[]
v.indgen() # can call any method
v.x[3] = 25 # assign to any field
h.finitialize(-65) # call any built-in function
print h.PI # or evaluate any built-in variable
h('objref m')
h('m = new Matrix(2,3)')
h.m.x[1][2] = 12 # how to deal with hoc object names
changed arguments. In Python this is supported by first wrapping an object,
string, or numeric value in a hoc.ref Python object, and using that as the
argument when call by reference is needed. For example:
Code: Select all
h('proc chstr() { $s1 = "goodbye" }') # call by ref hoc procedure
y = h.ref('hello') # python string wrapper
print y[0] #prints 'hello'
h.chstr(y)
print y[0] #prints 'goodbye'
The source code contains some of the development efforts in interfacing numpy by
Andrew Davison and Eilif Mueller.
The cache efficiency improvements were done in collaboration with Hubert Eichner.