Translating network models to parallel hardware in NEURON (Hines and Carnevale 2008)

 Download zip file   Auto-launch 
Help downloading and running models
Shows how to move a working network model written in NEURON from a serial processor to a parallel machine in such a way that the final result will produce numerically identical results on either serial or parallel hardware.
1 . Hines ML, Carnevale NT (2008) Translating network models to parallel hardware in NEURON. J Neurosci Methods 169:425-55 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism:
Cell Type(s):
Gap Junctions:
Simulation Environment: NEURON;
Model Concept(s): Simplified Models; Methods;
Implementer(s): Carnevale, Ted [Ted.Carnevale at]; Hines, Michael [Michael.Hines at];
load_file("nrngui.hoc")  // load the GUI and standard run libraries

// Step 1: Define the cell classes


// Steps 2 and 3 are to create the cells and connect the cells

NCELL = 20  // total number of cells in the ring network

objref cells, nclist  // will be Lists that hold all network cell
    // and NetCon instances, respectively

proc mkring() {
  mkcells($1)  // create the cells
  connectcells()  // connect them together

// creates the cells and appends them to a List called cells
// argument is the number of cells to be created
proc mkcells() {local i  localobj cell
  cells = new List()
  for i=0, $1-1 {
    cell = new B_BallStick()

// connects the cells
// appends the NetCons to a List called nclist
proc connectcells() {local i  localobj src, target, syn, nc
  nclist = new List()
  for i=0, cells.count-1 {  // iterating over sources
    src = cells.object(i)
    target = cells.object((i+1)%cells.count)
    syn = target.synlist.object(0)  // the first object in synlist
        // is an ExpSyn with e = 0, therefore an excitatory synapse
    nc = src.connect2target(syn)
    nc.delay = 1
    nc.weight = 0.01

mkring(NCELL)  // go ahead and create the net!

// Instrumentation, i.e. stimulation and recording

// stim will be an artificial spiking cell that generates a "spike" event
// that is delivered to the first cell in the net by ncstim
// in order to initiate network spiking.
// We won't bother including this "external stimulus source" or its NetCon
// in the network's lists of cells or NetCons.
objref stim, ncstim
proc mkstim() {
  stim = new NetStim()
  stim.number = 1
  stim.start = 0
  ncstim = new NetCon(stim, cells.object(0).synlist.object(0))
  ncstim.delay = 0
  ncstim.weight = 0.01


objref tvec, idvec  // will be Vectors that record all spike times (tvec)
        // and the corresponding id numbers of the cells that spiked (idvec)
proc spikerecord() {local i  localobj nc, nil
  tvec = new Vector()
  idvec = new Vector()
  for i=0, nclist.count-1 {
    nc = cells.object(i).connect2target(nil)
    nc.record(tvec, idvec, i)
    // the Vector will continue to record spike times
    // even after the NetCon has been destroyed


// Simulation control

tstop = 100

// Report simulation results

proc spikeout() { local i
  printf("\ntime\t cell\n")
  for i=0, tvec.size-1 {
    printf("%g\t %d\n", tvec.x[i], idvec.x[i])



Loading data, please wait...