neurodamus package

neurodamus

The neurodamus package implements the instantiation of simulations in Neuron based on a configuration file, a.k.a. simulation_config.json It is deeply based on the HOC implementation, therefore providing python modules like node, cell_distributor, etc; and still depends on several low-level HOC files at runtime.

Package-Level Classes

neurodamus.Neurodamus(config_file[, ...])

A high level interface to Neurodamus

neurodamus.Node(config_file[, options])

The Node class is the main entity for a distributed neurodamus execution.

Sub-Modules

neurodamus.cell_distributor

Mechanisms to load and balance cells across the computing resources.

neurodamus.connection_manager

Main module for handling and instantiating synaptical connections and gap-junctions

neurodamus.connection

Implementation of the core Connection classes

neurodamus.gap_junction

Main module for handling and instantiating synaptical connections

neurodamus.metype

Module which defines and handles METypes config (v5/v6 cells)

neurodamus.modification_manager

Implements applying modifications that mimic experimental manipulations

neurodamus.ngv

Module which defines and handles Glia Cells and connectivity

neurodamus.replay

Stimulus implementation where incoming synaptic events are replayed for a single gid

neurodamus.stimulus_manager

Implements coupling artificial stimulus into simulation

neurodamus.target_manager

Module API

neurodamus

class neurodamus.Neurodamus(config_file, auto_init=True, cleanup_atexit=True, logging_level=None, **user_opts)

A high level interface to Neurodamus

__init__(config_file, auto_init=True, cleanup_atexit=True, logging_level=None, **user_opts)

Creates and initializes a neurodamus run node

As part of Initiazation it calls:
  • load_targets

  • compute_load_balance

  • Build the circuit (cells, synapses, GJs)

  • Add stimulus & replays

  • Activate reports if requested

Parameters:
  • config_file – The simulation config recipe file

  • logging_level – (int) Redefine the global logging level. 0 - Only warnings / errors 1 - Info messages (default) 2 - Verbose 3 - Debug messages

  • cleanup_atexit – (bool) Call cleanup in the destructor [for more see: https://bbpteam.epfl.ch/project/issues/browse/BBPBGLIB-976]

  • user_opts – Options to Neurodamus overriding the simulation config file

init()

Explicitly initialize, allowing users to make last changes before simulation

run()

Prepares and launches the simulation according to the loaded config. If ‘–only-build-model’ option is set, simulation is skipped.

class neurodamus.Node(config_file, options=None)

The Node class is the main entity for a distributed neurodamus execution.

It internally instantiates parallel structures and distributes the cells among all the nodes. It is relatively low-level, for a standard run consider using the Neurodamus class instead.

class ReportParams(name, rep_type, report_on, unit, format, dt, start, end, output_dir, scaling)
dt

Alias for field number 5

end

Alias for field number 7

format

Alias for field number 4

name

Alias for field number 0

output_dir

Alias for field number 8

rep_type

Alias for field number 1

report_on

Alias for field number 2

scaling

Alias for field number 9

start

Alias for field number 6

unit

Alias for field number 3

all_circuits(exclude_disabled=True)
property circuits
cleanup()

Have the compute nodes wrap up tasks before exiting.

clear_model(avoid_creating_objs=False, avoid_clearing_queues=True)

Clears appropriate lists and other stored references. For use with intrinsic load balancing. After creating and evaluating the network using round robin distribution, we want to clear the cells and synapses in order to have a clean slate on which to instantiate the balanced cells.

compute_load_balance()

In case the user requested load-balance this function instantiates a CellDistributor to split cells and balance those pieces across the available CPUs.

create_cells(load_balance=None)

Instantiate and distributes the cells of the network. Any targets will be updated to know which cells are local to the cpu.

create_synapses()

Create synapses among the cells, handling connections that appear in the config file

dump_cell_config()
dump_circuit_config(suffix='nrn_python')
enable_modifications()

Iterate over any Modification blocks read from the config file and apply them to the network. The steps needed are more complex than NeuronConfigures, so the user should not be expected to write the hoc directly, but rather access a library of already available mods.

enable_replay()

Activate replay according to config file. Call before connManager.finalize

enable_reports()

Iterate over reports defined in the config file and instantiate them.

enable_stimulus()

Iterate over any stimuli/stim injects defined in the config file given to the simulation and instantiate them. This iterates over the injects, getting the stim/target combinations and passes the raw text in field/value pairs to a StimulusManager object to interpret the text and instantiate an actual stimulus object.

execute_neuron_configures()

Iterate over any NeuronConfigure blocks from the config file. These are simple hoc statements that can be executed with minimal substitutions

load_targets()

Initialize targets. Nodesets are loaded on demand.

property reports
run_all()

Run the whole simulation according to the simulation config file

sim_init(corenrn_gen=None, **sim_opts)

Finalize the model and prepare to run simulation.

After finalizing the model, will eventually write coreneuron config and initialize the neuron simulation if applicable.

Parameters:
  • corenrn_gen – Whether to generate coreneuron config. Default: None (if required)

  • spike_compress (sim_opts - override _finalize_model options. E.g.)

solve(tstop=None)

Call solver with a given stop time (default: whole interval). Be sure to have sim_init()’d the simulation beforehand

sonata_spikes()

Write the spike events that occured on each node into a single output SONATA file.

property stim_manager
property stims
property target_manager

Source

api/neurodamus.rst