Changeset 708 for trunk/examples/VAbenchmarks.py
- Timestamp:
- 02/12/10 16:02:09 (2 years ago)
- Files:
-
- 1 modified
-
trunk/examples/VAbenchmarks.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/VAbenchmarks.py
r705 r708 144 144 connections['ext2i'] = Projection(ext_stim, inh_cells, ext_conn, target='excitatory') 145 145 146 for prj in connections.keys():147 connections[prj].saveConnections('Results/VAbenchmark_%s_%s_%s_np%d.conn' % (benchmark, prj, simulator_name, np))148 149 146 # === Setup recording ========================================================== 150 147 print "%s Setting up recording..." % node_id … … 154 151 exc_cells.record_v(vrecord_list) 155 152 156 buildCPUTime = timer.elapsedTime() 153 buildCPUTime = timer.diff() 154 155 # === Save connections to file ================================================= 156 157 for prj in connections.keys(): 158 connections[prj].saveConnections('Results/VAbenchmark_%s_%s_%s_np%d.conn' % (benchmark, prj, simulator_name, np)) 159 saveCPUTime = timer.diff() 157 160 158 161 # === Run simulation =========================================================== 159 162 print "%d Running simulation..." % node_id 160 timer.reset()161 163 162 164 run(tstop) 163 165 164 simCPUTime = timer. elapsedTime()165 166 E_ rate = exc_cells.meanSpikeCount()*1000./tstop167 I_ rate = inh_cells.meanSpikeCount()*1000./tstop166 simCPUTime = timer.diff() 167 168 E_count = exc_cells.meanSpikeCount() 169 I_count = inh_cells.meanSpikeCount() 168 170 169 171 # === Print results to file ==================================================== 170 172 171 173 print "%d Writing data to file..." % node_id 172 timer.reset()173 174 174 175 if not(os.path.isdir('Results')): … … 178 179 inh_cells.printSpikes("Results/VAbenchmark_%s_inh_%s_np%d.ras" % (benchmark, simulator_name, np)) 179 180 exc_cells.print_v("Results/VAbenchmark_%s_exc_%s_np%d.v" % (benchmark, simulator_name, np)) 180 writeCPUTime = timer.elapsedTime() 181 182 tmp_string = "%d eâe %d eâi %d iâe %d iâi" % (connections['e2e'].size(), 183 connections['e2i'].size(), 184 connections['i2e'].size(), 185 connections['i2i'].size()) 186 187 def nprint(s): 188 """Small function to display information only on node 0.""" 189 if (node_id == 0): 190 print s 191 192 nprint("\n--- Vogels-Abbott Network Simulation ---") 193 nprint("Nodes : %d" % np) 194 nprint("Simulation type : %s" % benchmark) 195 nprint("Number of Neurons : %d" % n) 196 nprint("Number of Synapses : %s" % tmp_string) 197 nprint("Excitatory conductance : %g nS" % Gexc) 198 nprint("Inhibitory conductance : %g nS" % Ginh) 199 nprint("Excitatory rate : %g Hz" % E_rate) 200 nprint("Inhibitory rate : %g Hz" % I_rate) 201 nprint("Build time : %g s" % buildCPUTime) 202 nprint("Simulation time : %g s" % simCPUTime) 203 nprint("Writing time : %g s" % writeCPUTime) 181 writeCPUTime = timer.diff() 182 183 connections = "%d eâe %d eâi %d iâe %d iâi" % (connections['e2e'].size(), 184 connections['e2i'].size(), 185 connections['i2e'].size(), 186 connections['i2i'].size()) 187 188 if node_id == 0: 189 print "\n--- Vogels-Abbott Network Simulation ---" 190 print "Nodes : %d" % np 191 print "Simulation type : %s" % benchmark 192 print "Number of Neurons : %d" % n 193 print "Number of Synapses : %s" % connections 194 print "Excitatory conductance : %g nS" % Gexc 195 print "Inhibitory conductance : %g nS" % Ginh 196 print "Excitatory rate : %g Hz" % (E_count*1000.0/tstop,) 197 print "Inhibitory rate : %g Hz" % (I_count*1000.0/tstop,) 198 print "Build time : %g s" % buildCPUTime 199 print "Save connections time : %g s" % saveCPUTime 200 print "Simulation time : %g s" % simCPUTime 201 print "Writing time : %g s" % writeCPUTime 204 202 205 203
