diff --git a/README.md b/README.md index 1d05e15..1352470 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Cortical microcircuit simulation: PyNN version _Stored for easy access for people within the organisation_ -**Contributors:** -Sacha van Albada (s.van.albada@fz-juelich.de) -Maximilian Schmidt -Jannis Schücker +**Contributors:** +Sacha van Albada (s.van.albada@fz-juelich.de) +Maximilian Schmidt +Jannis Schücker Andrew Rowley Alan Stokes @@ -12,3 +12,84 @@ This is an implementation of the multi-layer microcircuit model of early sensory cortex published by Potjans and Diesmann (2014) _The cell-type specific cortical microcircuit: relating structure and activity in a full-scale spiking network model_. Cerebral Cortex 24 (3): 785-806, [doi:10.1093/cercor/bhs358](https://doi.org/10.1093/cercor/bhs358) + +It has been run on three different back-ends: NEST, SpiNNaker, and the ESS (emulator of HMF) + +# Instructions + +1. Ensure you have the desired back-end. + + For SpiNNaker see https://spinnakermanchester.github.io/latest/spynnaker.html + + For NEST see http://www.nest-initiative.org/index.php/Software:Download + and to enable full-scale simulation, compile it with MPI support + (use the --with-mpi option when configuring) according to the instructions on + http://www.nest-initiative.org/index.php/Software:Installation + +2. Install PyNN according to the instructions on + http://neuralensemble.org/docs/PyNN/installation.html + +3. Run the simulation by typing ```python run_microcircuit.py ``` in + your terminal in the folder containing this file, where `````` is one + of ```nest``` or ```spinnaker``` (by default ```spinnaker is selected```). There + are several potential arguments which can be seen by typing + ```python run_microcircuit.py -h```. A few useful ones include: + + - --sim_duration - The simulation duration in milliseconds (default 1000) + - --output_path - Where output files should be written (default results) + +6. Output files and basic analysis: + + - Spikes are written to .txt files containing IDs of the recorded neurons + and corresponding spike times in ms. + Separate files are written out for each population and virtual process. + File names are formed as 'spikes'+ layer + population + MPI process + .txt + - Voltages are written to .dat files containing GIDs, times in ms, and the + corresponding membrane potentials in mV. File names are formed as + voltmeter label + layer index + population index + spike detector GID + + virtual process + .dat + + - If 'plot_spiking_activity' is set to True, a raster plot and bar plot + of the firing rates are created and saved as 'spiking_activity.png' + + +The simulation was successfully tested with NEST revision 10711 and MPI 1.4.3. +Plotting works with Python 2.6.6 including packages numpy 1.3.0, +matplotlib 0.99.1.1, and glob. + +## Known issues: + +- At least with PyNN 0.7.5 and NEST revision 10711, ConnectWithoutMultapses + works correctly on a single process, but not with multiple MPI processes. + +- When saving connections to file, ensure that pyNN does not create problems + with single or nonexistent connections, for instance by adjusting + lib/python2.6/site-packages/pyNN/nest/__init__.py from line 365 as follows: + + if numpy.size(lines) != 0: + if numpy.shape(numpy.shape(lines))[0] == 1: + lines = numpy.array([lines]) + lines[:,2] *= 0.001 + if compatible_output: + lines[:,0] = self.pre.id_to_index(lines[:,0]) + lines[:,1] = self.post.id_to_index(lines[:,1]) + file.write(lines, {'pre' : self.pre.label, 'post' : self.post.label}) + +- To use saveConnections in parallel simulations, additionally ensure that + pyNN does not cause a race condition where the directory is created by one + process between the if statement and makedirs on another process: In + lib/python2.6/site-packages/pyNN/recording/files.py for instance replace + + os.makedirs(dir) + + by + + try: + os.makedirs(dir) + except OSError, e: + if e.errno != 17: + raise + pass + +Reinstall pyNN after making these adjustments, so that they take effect +in your pyNN installation directory. diff --git a/integration_tests/README.md b/integration_tests/README.md new file mode 100644 index 0000000..5591f7f --- /dev/null +++ b/integration_tests/README.md @@ -0,0 +1,3 @@ +These tests depend on https://github.com/SpiNNakerManchester/TestBase + +This is not added automatically by setup.py diff --git a/integration_tests/__init__.py b/integration_tests/__init__.py new file mode 100644 index 0000000..70661c8 --- /dev/null +++ b/integration_tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2017-2020 The University of Manchester +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . diff --git a/integration_tests/test_microcircuit.py b/integration_tests/test_microcircuit.py new file mode 100644 index 0000000..4048a58 --- /dev/null +++ b/integration_tests/test_microcircuit.py @@ -0,0 +1,37 @@ +# Copyright (c) 2017-2021 The University of Manchester +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from spinnaker_testbase import ScriptChecker +import os +import sys +import stat + + +class TestMicrocircuit(ScriptChecker): + + def test_microcircuit(self): + self.runsafe(self.microcircuit) + + def microcircuit(self): + self.check_script("run_microcircuit.py") + for result_file in [ + "spikes_L23E.pkl", "spikes_L23I.pkl", + "spikes_L4E.pkl", "spikes_L4I.pkl", + "spikes_L5E.pkl", "spikes_L5I.pkl", + "spikes_L6E.pkl", "spikes_L6I.pkl", + "spiking_activity.png"]: + result_path = os.path.join("results", result_file) + assert(os.path.exists(result_path)) + assert(os.stat(result_path)[stat.ST_SIZE]) diff --git a/microcircuit/README.txt b/microcircuit/README.txt deleted file mode 100644 index 32ce997..0000000 --- a/microcircuit/README.txt +++ /dev/null @@ -1,161 +0,0 @@ -/* - * README.txt - * - */ - -Cortical microcircuit simulation: PyNN version - -Contributors: -Sacha van Albada (s.van.albada@fz-juelich.de) -Maximilian Schmidt -Jannis Schücker -Andrew Rowley - -This is an implementation of the multi-layer microcircuit model of early -sensory cortex published by Potjans and Diesmann (2014) The cell-type specific -cortical microcircuit: relating structure and activity in a full-scale spiking -network model. Cerebral Cortex 24 (3): 785-806, doi:10.1093/cercor/bhs358. - -It has been run on three different back-ends: NEST, SpiNNaker, and the ESS (emulator of HMF) - -Files: - - network_params.py - Script containing model parameters - - - sim_params.py - Script containing simulation and system parameters - - - microcircuit.py - Simulation script - - - network.py - In which the network is set up - - - connectivity.py - Definition of connection routines - - - scaling.py - Functions for adjusting parameters to in-degrees - to approximately preserve firing rates - - - helper_functions.py - Auxiliary functions for creating the matrix of synaptic weights - and reading initial membrane potentials from file - - - plotting.py - Python script for creating raster and firing rate plot - - -Instructions: - -1. Ensure you have the desired back-end. - - For NEST see http://www.nest-initiative.org/index.php/Software:Download - and to enable full-scale simulation, compile it with MPI support - (use the --with-mpi option when configuring) according to the instructions on - http://www.nest-initiative.org/index.php/Software:Installation - - For using the ESS with VirtualBox, download the BSS Live System from - http://www.brainscales.org/bss-ubuntu-desktop.iso - The host system needs to be 64-bit. - - Alternatively, obtain a docker image from the KIP in Heidelberg. - -2. Install PyNN 0.7 according to the instructions on - http://neuralensemble.org/docs/PyNN/installation.html - -3. In sim_params.py: - - - set the simulation time via 'sim_duration' - - set 'output_path' and 'pyNN_path' - - For parallel simulation with NEST further adjust: - - the number of compute nodes 'n_nodes' - - the number of processes per node 'n_procs_per_node' - - queuing system parameters 'walltime' and 'memory' - - 'mpi_path', 'nest_path' - -4. In network_params.py: - - - If not yet present, add dictionary to params_dict for the back-end you wish to use - - Choose the network size via 'N_scaling' and 'K_scaling', - which scale the numbers of neurons and in-degrees, respectively - - Choose the external input via 'input_type' - - Optionally activate thalamic input via 'thalamic_input' - and set any thalamic input parameters - -5. Run the simulation by typing 'python microcircuit.py' in your terminal - (microcircuit.py and the parameter files need to be in the same folder) - -6. Output files and basic analysis: - - - Spikes are written to .txt files containing IDs of the recorded neurons - and corresponding spike times in ms. - Separate files are written out for each population and virtual process. - File names are formed as 'spikes'+ layer + population + MPI process + .txt - - Voltages are written to .dat files containing GIDs, times in ms, and the - corresponding membrane potentials in mV. File names are formed as - voltmeter label + layer index + population index + spike detector GID + - virtual process + .dat - - - If 'plot_spiking_activity' is set to True, a raster plot and bar plot - of the firing rates are created and saved as 'spiking_activity.png' - - -The simulation was successfully tested with NEST revision 10711 and MPI 1.4.3. -Plotting works with Python 2.6.6 including packages numpy 1.3.0, -matplotlib 0.99.1.1, and glob. - ---------------------------------------------------- - -Simulation on a single process: - -1. Go to the folder that includes microcircuit.py and the parameter files - -2. Adjust 'N_scaling' and 'K_scaling' in network_params.py such that the network - is small enough to fit on your system - -3. Ensure that the output directory exists, as it is not created via - run_microcircuit.py anymore - -4. Type 'python microcircuit.py' to start the simulation on a single process - - ---------------------------------------------------- - -Known issues: - -- At least with PyNN 0.7.5 and NEST revision 10711, ConnectWithoutMultapses - works correctly on a single process, but not with multiple MPI processes. - -- When saving connections to file, ensure that pyNN does not create problems - with single or nonexistent connections, for instance by adjusting - lib/python2.6/site-packages/pyNN/nest/__init__.py from line 365 as follows: - - if numpy.size(lines) != 0: - if numpy.shape(numpy.shape(lines))[0] == 1: - lines = numpy.array([lines]) - lines[:,2] *= 0.001 - if compatible_output: - lines[:,0] = self.pre.id_to_index(lines[:,0]) - lines[:,1] = self.post.id_to_index(lines[:,1]) - file.write(lines, {'pre' : self.pre.label, 'post' : self.post.label}) - -- To use saveConnections in parallel simulations, additionally ensure that - pyNN does not cause a race condition where the directory is created by one - process between the if statement and makedirs on another process: In - lib/python2.6/site-packages/pyNN/recording/files.py for instance replace - - os.makedirs(dir) - - by - - try: - os.makedirs(dir) - except OSError, e: - if e.errno != 17: - raise - pass - -Reinstall pyNN after making these adjustments, so that they take effect -in your pyNN installation directory. diff --git a/microcircuit/__init__.py b/microcircuit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/microcircuit/nest_specific_info.py b/microcircuit/nest_specific_info.py index ae6bbbe..c87d8cc 100644 --- a/microcircuit/nest_specific_info.py +++ b/microcircuit/nest_specific_info.py @@ -1,8 +1,8 @@ import os from past.builtins import xrange -from sim_params import NestParams -from constants import DC, NEST_NEURON_MODEL, CONN_ROUTINE +from .sim_params import NestParams +from .constants import DC, NEST_NEURON_MODEL, CONN_ROUTINE import numpy @@ -84,15 +84,27 @@ class NestSimulatorInfo(NestParams): ] def __init__( - self, parallel_safe=True, n_scaling=1.0, k_scaling=1.0, - neuron_model=NEST_NEURON_MODEL, conn_routine=CONN_ROUTINE, - save_connections=False, voltage_input_type='random', - delay_dist_type='normal', input_type=DC, record_fraction=True, - n_record=100, frac_record_spikes=1.0, record_v=False, - n_record_v=20, frac_record_v=0.1, record_corr=False, - pyseed=2563297, master_seed=124678, - tau_syn_name='tau_syn_ex'): - super(NestSimulatorInfo, self).__init__() + self, timestep=0.1, sim_duration=10000.0, min_delay=0.1, + max_delay=100.0, n_nodes=1, outfile='output.txt', + errfile='errors.txt', output_path='results', output_format='pkl', + conn_dir='connectivity', n_procs_per_node=24, wall_time='8:0:0', + memory='4gb', + mpi_path=( + '/usr/local/mpi/openmpi/1.4.3/gcc64/bin/' + 'mpivars_openmpi-1.4.3_gcc64.sh'), + backend_path='/path/to/backend', pynn_path='/path/to/pyNN', + parallel_safe=True, n_scaling=1.0, + k_scaling=1.0, neuron_model=NEST_NEURON_MODEL, + conn_routine=CONN_ROUTINE, save_connections=False, + voltage_input_type='random', delay_dist_type='normal', + input_type=DC, record_fraction=True, n_record=100, + frac_record_spikes=1.0, record_v=False, n_record_v=20, + frac_record_v=0.1, record_corr=False, pyseed=2563297, + master_seed=124678, tau_syn_name='tau_syn_ex'): + super(NestSimulatorInfo, self).__init__( + timestep, sim_duration, min_delay, max_delay, n_nodes, outfile, + errfile, output_path, output_format, conn_dir, n_procs_per_node, + wall_time, memory, mpi_path, backend_path, pynn_path) self.parallel_safe = parallel_safe self.n_scaling = n_scaling self.k_scaling = k_scaling diff --git a/microcircuit/network.py b/microcircuit/network.py index 620d3b4..fd73930 100644 --- a/microcircuit/network.py +++ b/microcircuit/network.py @@ -1,10 +1,11 @@ -from connectivity import build_from_list_connect -from constants import ( +from .connectivity import build_from_list_connect +from .constants import ( DC, NEST_NEURON_MODEL, SPINNAKER_NEURON_MODEL, POISSON, CONN_ROUTINE) -from sim_params import SIMULATOR, NEST_SIM, SPINNAKER_SIM -from scaling import get_in_degrees, adjust_w_and_ext_to_k -from helper_functions import ( +from .sim_params import NEST_SIM, SPINNAKER_SIM +from .scaling import get_in_degrees, adjust_w_and_ext_to_k +from .helper_functions import ( create_weight_matrix, get_init_voltages_from_file) + from pyNN.random import NumpyRNG, RandomDistribution import numpy as np @@ -16,10 +17,12 @@ class Network: __slots__ = [ 'pops', + 'simulator' ] - def __init__(self): + def __init__(self, simulator): self.pops = {} + self.simulator = simulator def setup(self, sim, simulator_specific_info, common_params): """ creates the PyNN network @@ -123,7 +126,7 @@ def setup(self, sim, simulator_specific_info, common_params): else: model = getattr(sim, simulator_specific_info.neuron_model) - if SIMULATOR == NEST_SIM: + if self.simulator == NEST_SIM: simulator_specific_info.record_corr_info(sim, common_params) if sim.rank() == 0: @@ -137,7 +140,7 @@ def setup(self, sim, simulator_specific_info, common_params): for layer in sorted(common_params.layers): for pop in sorted(common_params.pops): print(layer, pop, common_params.n_rec[layer][pop]) - if SIMULATOR == NEST_SIM: + if self.simulator == NEST_SIM: simulator_specific_info.rank_info( common_params, layer, pop) @@ -182,11 +185,11 @@ def setup(self, sim, simulator_specific_info, common_params): simulator_specific_info.set_record_v(this_pop) # Correlation recording - if SIMULATOR == NEST_SIM: + if self.simulator == NEST_SIM: simulator_specific_info.set_corr_recording( layer, pop, common_params, sim, this_pop) - if SIMULATOR == NEST_SIM: + if self.simulator == NEST_SIM: simulator_specific_info.set_defaults(sim) thalamic_population = None @@ -219,7 +222,7 @@ def setup(self, sim, simulator_specific_info, common_params): common_params.bg_rate * k_ext[target_layer][target_pop]) - if SIMULATOR == NEST_SIM: + if self.simulator == NEST_SIM: simulator_specific_info.create_poissons( sim, target_layer, target_pop, rate, this_target_pop, w_ext, common_params) @@ -247,7 +250,7 @@ def setup(self, sim, simulator_specific_info, common_params): n_target * simulator_specific_info.k_scaling) if simulator_specific_info.conn_routine == CONN_ROUTINE: - if SIMULATOR == SPINNAKER_SIM: + if self.simulator == SPINNAKER_SIM: simulator_specific_info.fixed_tot_number_connect( sim, thalamic_population, this_target_pop, k_thal, w_ext, common_params.w_rel * w_ext, @@ -293,7 +296,7 @@ def setup(self, sim, simulator_specific_info, common_params): if (simulator_specific_info.conn_routine == CONN_ROUTINE): - if SIMULATOR == SPINNAKER_SIM: + if self.simulator == SPINNAKER_SIM: simulator_specific_info.\ fixed_tot_number_connect( sim, this_source_pop, this_target_pop, diff --git a/microcircuit/scaling.py b/microcircuit/scaling.py index a0b5053..7702ec8 100644 --- a/microcircuit/scaling.py +++ b/microcircuit/scaling.py @@ -3,7 +3,7 @@ ############################################################################# import numpy as np -from constants import POISSON +from .constants import POISSON def get_in_degrees(common_params): @@ -50,7 +50,7 @@ def adjust_w_and_ext_to_k( :return: w_new, w_ext_new, i_ext """ internal_scaling = k_scaling - + w_new = w / np.sqrt(internal_scaling) w_ext_new = None i_ext = {} diff --git a/microcircuit/sim_params.py b/microcircuit/sim_params.py index 459163c..819115d 100644 --- a/microcircuit/sim_params.py +++ b/microcircuit/sim_params.py @@ -1,10 +1,10 @@ ################################################### # Simulation parameters ################################################### +from inspect import getargspec NEST_SIM = "NEST" SPINNAKER_SIM = "SPINNAKER" -SIMULATOR = SPINNAKER_SIM class SimParams(object): @@ -105,3 +105,21 @@ def __init__( super(SpinnakerParams, self).__init__( timestep, sim_duration, min_delay, max_delay, outfile, errfile, output_path, output_format, conn_dir) + + +def add_subparser(subparsers, command, method): + argspec = getargspec(method) + args_with_defaults = argspec.args + args_without_defaults = [] + if argspec.defaults: + args_with_defaults = argspec.args[-len(argspec.defaults):] + args_without_defaults = argspec.args[:-len(argspec.defaults)] + + args = subparsers.add_parser(command) + for arg in args_without_defaults: + if arg is not "self": + args.add_argument(arg, action="store") + if argspec.defaults: + for arg, default in zip(args_with_defaults, argspec.defaults): + args.add_argument("--" + arg, action="store", default=default) + return args diff --git a/microcircuit/spinnaker_specific_info.py b/microcircuit/spinnaker_specific_info.py index af7485f..30e08f7 100644 --- a/microcircuit/spinnaker_specific_info.py +++ b/microcircuit/spinnaker_specific_info.py @@ -1,5 +1,5 @@ -from sim_params import SpinnakerParams -from constants import POISSON, SPINNAKER_NEURON_MODEL, CONN_ROUTINE +from .sim_params import SpinnakerParams +from .constants import POISSON, SPINNAKER_NEURON_MODEL, CONN_ROUTINE from pyNN.random import RandomDistribution import numpy @@ -77,15 +77,20 @@ class SpinnakerSimulatorInfo(SpinnakerParams): ] def __init__( - self, parallel_safe=True, n_scaling=1.0, k_scaling=1.0, - neuron_model=SPINNAKER_NEURON_MODEL, conn_routine=CONN_ROUTINE, - save_connections=False, voltage_input_type='pop_random', - delay_dist_type='normal', input_dir='voltages_0.1_0.1_delays', - input_type=POISSON, record_fraction=True, - n_record=100, frac_record_spikes=1.0, record_v=False, - frac_record_v=0.1, pyseed=2563297, live_output=False, - tau_syn_name='tau_syn_E'): - super(SpinnakerSimulatorInfo, self).__init__() + self, timestep=0.1, sim_duration=1000.0, min_delay=0.1, + max_delay=14.4, outfile='output.txt', errfile='errors.txt', + output_path='results', output_format='pkl', + conn_dir='connectivity', parallel_safe=True, n_scaling=1.0, + k_scaling=1.0, neuron_model=SPINNAKER_NEURON_MODEL, + conn_routine=CONN_ROUTINE, save_connections=False, + voltage_input_type='pop_random', delay_dist_type='normal', + input_dir='voltages_0.1_0.1_delays', input_type=POISSON, + record_fraction=True, n_record=100, frac_record_spikes=1.0, + record_v=False, frac_record_v=0.1, pyseed=2563297, + live_output=False, tau_syn_name='tau_syn_E'): + super(SpinnakerSimulatorInfo, self).__init__( + timestep, sim_duration, min_delay, max_delay, outfile, errfile, + output_path, output_format, conn_dir) self.parallel_safe = parallel_safe self.n_scaling = n_scaling self.k_scaling = k_scaling diff --git a/results/.gitignore b/results/.gitignore new file mode 100644 index 0000000..f7f4af1 --- /dev/null +++ b/results/.gitignore @@ -0,0 +1,2 @@ +*.pkl +*.png diff --git a/microcircuit/microcircuit.py b/run_microcircuit.py similarity index 55% rename from microcircuit/microcircuit.py rename to run_microcircuit.py index 6d15060..9b54754 100644 --- a/microcircuit/microcircuit.py +++ b/run_microcircuit.py @@ -3,29 +3,55 @@ ################################################### import sys import time -import plotting -from network import Network -from sim_params import NEST_SIM, SPINNAKER_SIM, SIMULATOR -from spinnaker_specific_info import SpinnakerSimulatorInfo -from nest_specific_info import NestSimulatorInfo -from common_params import CommonParams +from argparse import ArgumentParser + +from microcircuit import plotting +from microcircuit.network import Network +from microcircuit.sim_params import NEST_SIM, SPINNAKER_SIM, add_subparser +from microcircuit.spinnaker_specific_info import SpinnakerSimulatorInfo +from microcircuit.nest_specific_info import NestSimulatorInfo +from microcircuit.common_params import CommonParams + +sim_parser = ArgumentParser(add_help=False) +sim_parser.add_argument("simulator", nargs="?", action="store") +sim_parser.add_argument("-h", "--help", action="store_true") +args, extras = sim_parser.parse_known_args() +argv = list() +if args.simulator is not None: + argv.append(args.simulator) +if args.help: + argv.append("-h") +elif args.simulator is None: + argv.append("spinnaker") +argv.extend(extras) + +parser = ArgumentParser() +subparsers = parser.add_subparsers(dest="simulator") +add_subparser(subparsers, "spinnaker", SpinnakerSimulatorInfo.__init__) +add_subparser(subparsers, "nest", NestSimulatorInfo.__init__) +args = parser.parse_args(argv) + +simulator = args.simulator.upper() +arg_dict = vars(args) +del arg_dict["simulator"] # build sim params -if SIMULATOR == NEST_SIM: - simulator_specific_info = NestSimulatorInfo() +if simulator == NEST_SIM: + simulator_specific_info = NestSimulatorInfo(**arg_dict) else: - simulator_specific_info = SpinnakerSimulatorInfo() + simulator_specific_info = SpinnakerSimulatorInfo(**arg_dict) # build common params common_params = CommonParams(simulator_specific_info) # do nest'y things -if SIMULATOR == NEST_SIM: +if simulator == NEST_SIM: + import pyNN.nest as sim sys.path.append(simulator_specific_info.backend_path) sys.path.append(simulator_specific_info.pynn_path) # prepare simulation -if SIMULATOR == SPINNAKER_SIM: +if simulator == SPINNAKER_SIM: import spynnaker8 as sim sim.setup(**simulator_specific_info.setup_params) @@ -33,13 +59,13 @@ # create network start_netw = time.time() -network = Network() +network = Network(simulator) network.setup(sim, simulator_specific_info, common_params) end_netw = time.time() if sim.rank() == 0: - print( 'Creating the network took ', end_netw - start_netw, ' s') + print('Creating the network took ', end_netw - start_netw, ' s') -if SIMULATOR == NEST_SIM: +if simulator == NEST_SIM: simulator_specific_info.memory_print(sim) # simulate @@ -51,15 +77,15 @@ if sim.rank() == 0: print('Simulation took ', end_sim - start_sim, ' s') -if SIMULATOR == NEST_SIM: +if simulator == NEST_SIM: simulator_specific_info.memory_print(sim) start_writing = time.time() for layer in common_params.layers: for pop in common_params.pops: filename = ( - simulator_specific_info.output_path + '/spikes_' + layer + pop + '.' + - simulator_specific_info.output_format) + simulator_specific_info.output_path + '/spikes_' + layer + pop + + '.' + simulator_specific_info.output_format) network.pops[layer][pop].write_data(io=filename, variables='spikes') if simulator_specific_info.record_v: @@ -70,7 +96,7 @@ pop + '.dat') network.pops[layer][pop].print_v(filename, gather=True) -if SIMULATOR == NEST_SIM: +if simulator == NEST_SIM: simulator_specific_info.after_run_info(sim, common_params) diff --git a/microcircuit/spynnaker.cfg b/spynnaker.cfg similarity index 100% rename from microcircuit/spynnaker.cfg rename to spynnaker.cfg