.TH CNrun 1 "2013-09-23" 1.1.14 "CNrun" .SH NAME CNrun -- a neuronal network simulator .SH SYNOPSIS cnrun \fB\-h\fR | \fB\-U\fR | \fB\-e\fR \fIscript\fR [\fBOPTION\fR ...] .B .PP .SH DESCRIPTION .PP \fBCNrun\fR is a neuronal network simulator, similar to NEURON or GENESIS, but without provision for unit compartments. It reads the network topology in NeuroML format as exported, f.i., by neuroConstruct. Unit types are determined by the \(oqcell_type\(cq attribute in the .nml definitions. Available neuron types, by the corresponding \(oqcell_type\(cq string, include: .IP \(bu \fIHH\fR and \fIHHRate\fR, conductance\- and rate\-based Hodgkin\-Huxley neurons (Traub & Miles, 1991); .IP \(bu A simplified but fast, fixed\-dt \fIMap\fR neurons mimicking the HH model; .IP \(bu \fIPoisson\fR, Van der Pol (\fIVdP\fR) and simple \fIPulse\fR oscillators; .IP \(bu synapses as described in Rall et al, 1967 (\fIRall\fR) and Destexhe et al, 1994 (\fIAB\fR). .PP Unit parameters can be set via a \fBset_parm_*\fR command (see \fBSCRIPTING\fR below); values can be set once before the simulation, or continuously or periodically per user\-defined schedule. A 6\-5\-order Runge\-Kutta integration method is used to compute state variables. These (membrane potential E or instantaneous firing rate R for neurons, neurotransmitter release S for synapses) as well as spike times can be logged. Scripting support in CNrun includes commands for creating and populating a model, setting parameters for single units or groups selected based on regex matching. Variables (\(oqa = 1; b = a + 2\(cq) and arithmetic expressions (\(oq\-\(cq, \(oq+\(cq, \(oq*\(cq, \(oq/\(cq, \(oq()\(cq ) are supported. .SH OPTIONS \fB\-C\fR \fIdir\fR chdir to \fIdir\fR before running. .TP \fB\-D\fR Dump all unit types in the model and exit. .TP \fB\-e\fR [\fIscript\fR] Execute \fIscript\fR. If this option is given without a file name (or not given at all), start an interactive interpreter. .TP \fB\-s\fR Sort units (mostly useful with verbose output). .TP \fB\-L\fR[1dbxL] For all listeners: .RS 4 .IP d Defer writing to disk until done rather than write continuously (speeds up the simulation but you can\(cqt watch the progress live with gnuplot) .IP 1 Only log the first variable (appropriate for the HH model, which units have in excess the three uninteresting gating parameters). .IP b Write in native binary form rather than in ASCII. This will speed up viewing the (now label.varx files) with gnuplot. Do your plotting with \(lqbinary format="%lf%lf"\(rq to achieve this. These options can also be set using command \fBlisten_mode\fR (which see, below). .IP L log integrator dt. .RE .TP \fB\-E\fR \fIdouble\fR Listen at this interval (default 1 msec; set to 0 to listen every cycle, which can slow cnrun down considerably). Also available as command \fBlisten_dt\fR. .TP \fB\-k\fR[l|0] Write a model\-wide log of spiking neurons, using labels (\(oql\(cq) or unit ids (\(oq0\(cq). .TP \fB\-e \fIuint\fR Set precision for all output (default 8). .TP \fB\-iT\fIdouble\fR dt_max (default 0.5). .TP \fB\-it\fIdouble\fR dt_min (default 1e\-05). .TP \fB\-ix\fIdouble\fR Cap dt increase by current dt value x this (default 5). .TP \fB\-nc\fR Disable synapse coalescing (for benchmarking). .TP \fB\-v \fIint\fR Set verbosity level (default 1; values up to 7 are meaningful). Use a negative value to show the progress percentage only, indented on the line at \-8 x this value. .TP \fB\-U\fR List all available units. .TP \fB\-h\fR Print the overview of command\-line options. Space is optional between the option letter and argument for single\-letter options. In all two\-letter options taking an argument though, make sure there is no space in between. .SH SCRIPTING Commands are delimited by a colon or new\-line. Comments are lines starting with #. The following commands are available: .TP \fBnew_model\fR NAME Create a new model called NAME. Existing model is deleted. .TP \fBuse_nml\fR NML_FILE Load network topology from NML_FILE, creating a model if necessary, or replacing an existing model\(rq topology. .TP \fBmerge_nml\fR NML_FILE Merge in the topology from NML_FILE. .TP \fBadd_neuron\fR TYPE LABEL Add a new newron of type TYPE with label LABEL. .TP \fBadd_synapse\fR TYPE SOURCE TARGET G Connect the neuron labelled SOURCE to one labelled TARGET with a synapse of type TYPE, with gsyn G. .TP \fBcull_deaf_synapses\fR Remove synapses with zero weight. .TP \fBset_parm_neuron\fR LABEL PARM VALUE Set parameter PARM for a specified group of neurons labelled matching LABEL. .TP \fBset_parm_synapse\fR SRC TGT PARM VALUE Set parameter PARM for synapses between neurons labelled matching SRC and TGT. The synaptic weight, itself not being a synapse parameter, can also be set with this command: to do this, use \(oqgsyn\(cq as PARM. .TP \fBreset\fR Reset the model. Model time is rewound to 0 and all units have their state variables reset to stock defaults. Any previously assigned unit parameters and attached data sources are preserved. .TP \fBreset_revert_params\fR Reset the model. Model time is rewound to 0, all units have their state variables and parameters reset to stock defaults. .TP \fBreset_state_units\fR REGEX Reset the units\(cq as above, keeping current model time. .TP \fBadvance_until\fR TIME Advance until TIME msec. .TP \fBadvance\fR TIME Advance TIME msec. .TP \fBputout\fR REGEX Delete units matching REGEX by label. .TP \fBdecimate\fR REGEX FRAC Randomly delete FRAC units of a population of units selected by REGEX. .TP \fBstart_listen\fR REGEX Make matching units listen. .TP \fBstop_listen\fR Make matching units stop listening. .TP \fBlisten_dt\fR [VALUE] Set listening interval to VALUE, or show current value if VALUE not given. .TP \fBlisten_mode\fR [SPEC] Print (if argument is omitted) the current listening mode (one var only, deferred write, and/or binary); otherwise, enable the corresponding mode if \(oq1\(cq, \(oqd\(cq or \(oqb\(cq occurs in SPEC, or disable it if it does and is immediately followed by a \(oq\-\(cq. Note that those units already listening will be unaffected; to change the mode for them, issue \fBstart_listen\fR for them after the new mode has been set. .TP \fBstart_log_spikes\fR REGEX Make neurons matching REGEX log spikes. .TP \fBstop_log_spikes\fR REGEX Make neurons matching REGEX stop log spikes. .TP \fBsxf_params\fR DELAY:PERIOD:SIGMA Set spike density function initial delay, sampling period and sigma as specified. .TP \fBdescribe_model\fR Print a summary of model topology and unit types. .TP \fBshow_units\fR REGEX Print parameters and state of units matching REGEX. .TP \fBnew_source\fR TYPE ID ARG ... Create a new source of type and with an id as indicated. Sources can be connected to unit parameters as a means to set up a dynamically changing behaviour. See \fBDYNAMIC SOURCES\fR below. .TP \fBconnect_source\fR SOURCE_ID LABEL PARM Connect this source to matching units\(cq parameter. .TP \fBshow_sources\fR Show the currently active sources (both connected and idle). .TP \fBexec\fR [SCRIPT] Execute a script. If SCRIPT not specified, start an interactive interpreter. .TP \fBverbosity\fR [LEVEL] Set/show verbosity level. .TP \fBshow_vars\fR [REGEX] Print variables matching REGEX, or all variables if REGEX omitted. .TP \fBclear_vars\fR [REGEX] Clear variables matching REGEX, or all if REGEX omitted. .TP \fBpause\fR [DELAY] Pause for DELAY sec if specified, or until user presses Enter otherwise. .TP \fBquit\fR Exit current interpreter if called by \fBexec\fR; exit the program otherwise. .RE When you use the interpreter interactively, TAB will list completions approproiately, depending on the context. .SH DYNAMIC SOURCES In addition to static unit parameter/variable assignment with \fBset_parm_{neuron,synapse}\fR, units can have a data source attached to any of their parameters or variable (even though variables will get overwritten in the next cycle). Data sources are of three types (a fourth one is available for developers, an arbitrary user function of time, but not exposed as an interpreter command). Where data for a source are read from a file, values are read using a \(oq>>\(cq operator (from ) into a double variable. The corresponding \fBnew_source\fR arguments are: .TP \fBTape\fR FILE Read \(lqtime value\(rq pairs from FILE and set the parameter\(cqs value accordingly. .TP \fBPeriodic\fR FILE FILE is expected to contain, as the first number value read by scanf("%lg"), a time period at which the following values are sequentially assigned to the parameter. Values are assigned at the beginning of each integration cycle. .TP \fBNoise\fR MIN:MAX Generate (irrespective of time) a uniformly distributed random number within MIN:MAX. .RE Similarly to the parameters, state variables can also be set in this manner; in this case, the values read, will override whatever the inner workings of the unit assign to it. Where a Tape has a gap between assignment times larger than current dt, assignments are still made; this, however, does not apply to Periodic sources (chiefly for performance reasons). .SH SYNAPSE COALESCING Coalesced synapses are those having identical parameters and having the same source. Coalescing reduces, per divergence rate, the number of times the S variable is recomputed with identical parameters per cycle; additionally for hosted synapses, the integration vector is shrunk to fit towards further performance gain. Coalescing happens automatically between two synapses from same source when, after all parameter assignments, they are found to be identical (disregarding synaptic weights). Conversely, when the user changes a parameter to one coalesced synapses that is different from that parameter\(cqs value in the others, that synapse becomes independent. Note that a synapse units\(cqs label is dynamically formed of the label of the source with a semicolon and the current number of targets. Another consequence of coalescing is that there can be more than one synapse units labelled identically (hence, uniquely to identify a synapse, you need to specify its source and target). The command\-line option \fB\-nc\fR can be used to disable coalescing. .SH FILES .TP \fI.cnrun\-history\fR, a per\-directory history of entered commands. .SH EXAMPLE In /usr/share/doc/cnrun/ratiocoding, there is a working example of cnrun setup which reproduces some of the results presented in Zavada et al (2011) PLoS paper. .SH BUGS The oscillator units other than Poisson, have not been tested. .SH SEE ALSO spike2sdf(1), varfold(1). .SH AUTHOR CNRun and the underlying library libcn is written by Andrei Zavada , building on the original code by Thomas Nowotny, while at Sussex University in 2008\-10.