Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Functions
sim_coba_benchmark.cpp File Reference

Simulation code for the Vogels Abbott benchmark following Brette et al. (2007) More...

#include "auryn.h"
Include dependency graph for sim_coba_benchmark.cpp:

Functions

int main (int ac, char *av[])
 

Detailed Description

Simulation code for the Vogels Abbott benchmark following Brette et al. (2007)

This simulation implements the Vogels Abbott benchmark as suggested by Brette et al. (2007) Journal of Computational Neuroscience 23: 349-398.

The network is based on a network by Vogels and Abbott as described in Vogels, T.P., and Abbott, L.F. (2005). Signal propagation and logic gating in networks of integrate-and-fire neurons. J Neurosci 25, 10786.

We used this network for benchmarking Auryn against other simulators in Zenke, F., and Gerstner, W. (2014). Limits to high-speed simulations of spiking neural networks using general-purpose computers. Front Neuroinform 8, 76.

See build/release/run_benchmark.sh for automatically run benchmarks to compare the performance of different Auryn builds.

Function Documentation

◆ main()

int main ( int  ac,
char *  av[] 
)
48  {
49  string dir = "/tmp";
50 
51  string fwmat_ee = "";
52  string fwmat_ei = "";
53  string fwmat_ie = "";
54  string fwmat_ii = "";
55 
56  std::stringstream oss;
57  string strbuf ;
58  string msg;
59 
60  double w = 0.4; // [g_leak]
61  double wi = 5.1; // [g_leak]
62 
63 
64 
65  double sparseness = 0.02;
66  double simtime = 20.;
67 
68  NeuronID ne = 3200;
69  NeuronID ni = 800;
70 
71  bool fast = false;
72 
73  int errcode = 0;
74 
75 
76  try {
77 
78  po::options_description desc("Allowed options");
79  desc.add_options()
80  ("help", "produce help message")
81  ("simtime", po::value<double>(), "simulation time")
82  ("fast", "turns off most monitoring to reduce IO")
83  ("dir", po::value<string>(), "load/save directory")
84  ("fee", po::value<string>(), "file with EE connections")
85  ("fei", po::value<string>(), "file with EI connections")
86  ("fie", po::value<string>(), "file with IE connections")
87  ("fii", po::value<string>(), "file with II connections")
88  ;
89 
90  po::variables_map vm;
91  po::store(po::parse_command_line(ac, av, desc), vm);
92  po::notify(vm);
93 
94  if (vm.count("help")) {
95  std::cout << desc << "\n";
96  return 1;
97  }
98 
99  if (vm.count("simtime")) {
100  simtime = vm["simtime"].as<double>();
101  }
102 
103  if (vm.count("fast")) {
104  fast = true;
105  }
106 
107  if (vm.count("dir")) {
108  dir = vm["dir"].as<string>();
109  }
110 
111  if (vm.count("fee")) {
112  fwmat_ee = vm["fee"].as<string>();
113  }
114 
115  if (vm.count("fie")) {
116  fwmat_ie = vm["fie"].as<string>();
117  }
118 
119  if (vm.count("fei")) {
120  fwmat_ei = vm["fei"].as<string>();
121  }
122 
123  if (vm.count("fii")) {
124  fwmat_ii = vm["fii"].as<string>();
125  }
126 
127  }
128  catch(std::exception& e) {
129  std::cerr << "error: " << e.what() << "\n";
130  return 1;
131  }
132  catch(...) {
133  std::cerr << "Exception of unknown type!\n";
134  }
135 
136 
137  auryn_init( ac, av, dir );
138  oss << dir << "/coba." << sys->mpi_rank() << ".";
139  string outputfile = oss.str();
140  if ( fast ) sys->quiet = true;
141 
143 
144 
145  logger->msg("Setting up neuron groups ...",PROGRESS,true);
146 
147  TIFGroup * neurons_e = new TIFGroup( ne);
148  TIFGroup * neurons_i = new TIFGroup( ni);
149 
150  neurons_e->set_refractory_period(5.0e-3); // minimal ISI 5.1ms
151  neurons_i->set_refractory_period(5.0e-3);
152 
153  neurons_e->set_state("bg_current",2e-2); // corresponding to 200pF for C=200pF and tau=20ms
154  neurons_i->set_state("bg_current",2e-2);
155 
156 
157  logger->msg("Setting up E connections ...",PROGRESS,true);
158 
159  SparseConnection * con_ee
160  = new SparseConnection( neurons_e,neurons_e, w, sparseness, GLUT);
161 
162  SparseConnection * con_ei
163  = new SparseConnection( neurons_e,neurons_i, w,sparseness,GLUT);
164 
165 
166 
167  logger->msg("Setting up I connections ...",PROGRESS,true);
168  SparseConnection * con_ie
169  = new SparseConnection( neurons_i,neurons_e,wi,sparseness,GABA);
170 
171  SparseConnection * con_ii
172  = new SparseConnection( neurons_i,neurons_i,wi,sparseness,GABA);
173 
174  if ( !fwmat_ee.empty() ) con_ee->load_from_complete_file(fwmat_ee);
175  if ( !fwmat_ei.empty() ) con_ei->load_from_complete_file(fwmat_ei);
176  if ( !fwmat_ie.empty() ) con_ie->load_from_complete_file(fwmat_ie);
177  if ( !fwmat_ii.empty() ) con_ii->load_from_complete_file(fwmat_ii);
178 
179 
180 
181  if ( !fast ) {
182  logger->msg("Use --fast option to turn off IO for benchmarking!", WARNING);
183 
184  msg = "Setting up monitors ...";
185  logger->msg(msg,PROGRESS,true);
186 
187  std::stringstream filename;
188  filename << outputfile << "e.ras";
189  SpikeMonitor * smon_e = new SpikeMonitor( neurons_e, filename.str().c_str() );
190 
191  filename.str("");
192  filename.clear();
193  filename << outputfile << "i.ras";
194  SpikeMonitor * smon_i = new SpikeMonitor( neurons_i, filename.str().c_str() );
195  }
196 
197 
198  // RateChecker * chk = new RateChecker( neurons_e , -0.1 , 1000. , 100e-3);
199 
200  logger->msg("Simulating ..." ,PROGRESS,true);
201  if (!sys->run(simtime,true))
202  errcode = 1;
203 
204  if ( sys->mpi_rank() == 0 ) {
205  logger->msg("Saving elapsed time ..." ,PROGRESS,true);
206  char filenamebuf [255];
207  sprintf(filenamebuf, "%s/elapsed.dat", dir.c_str());
208  std::ofstream timefile;
209  timefile.open(filenamebuf);
210  timefile << sys->get_last_elapsed_time() << std::endl;
211  timefile.close();
212  }
213 
214  if (errcode)
215  auryn_abort(errcode);
216 
217  logger->msg("Freeing ..." ,PROGRESS,true);
218  auryn_free();
219  return errcode;
220 }
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
void set_logfile_loglevel(LogMessageType level=NOTIFICATION)
Sets loglevel for file output.
Definition: Logger.cpp:63
unsigned int mpi_rank()
Returns current rank.
Definition: System.cpp:1009
double get_last_elapsed_time()
Returns last elapsed time in seconds.
Definition: System.cpp:956
void set_state(std::string name, AurynState val)
Conveniently sets all values in a state vector identified by name in this group.
Definition: NeuronGroup.cpp:132
Definition: Logger.h:41
virtual bool load_from_complete_file(string filename)
Loads weight matrix from a single file.
Definition: SparseConnection.cpp:921
The base class to create sparse random connections.
Definition: SparseConnection.h:66
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
The standard Monitor object to record spikes from a SpikingGroup and write them to a text file...
Definition: SpikeMonitor.h:52
bool quiet
Switch to turn output to quiet mode (no progress bar).
Definition: System.h:158
void auryn_abort(int errcode)
Terminates Auryn simulation abnormally.
Definition: auryn_global.cpp:113
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
Conductance based LIF neuron model with absolute refractoriness as used in Vogels and Abbott 2005...
Definition: TIFGroup.h:38
void auryn_init(int ac, char *av[], string dir, string simulation_name, string logfile_prefix, LogMessageType filelog_level, LogMessageType consolelog_level)
Initalizes MPI and the Auryn simulation environment.
Definition: auryn_global.cpp:84
Standard Gabaergic (inhibitory) transmission.
Definition: auryn_definitions.h:140
void msg(std::string text, LogMessageType type=NOTIFICATION, bool global=false, int line=-1, std::string srcfile="")
Definition: Logger.cpp:74
Definition: Logger.h:41
Definition: Logger.h:41
void set_refractory_period(AurynDouble t)
Setter for refractory time [s].
Definition: TIFGroup.cpp:204
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
Here is the call graph for this function: