2019-11-30 15:53:10,242 DIAGNOSTIC brian2: Logging to file: /tmp/brian_debug_zftk8ara.log, copy of main script saved as: /tmp/brian_script_fc3nyjs_.py 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: Python interpreter: /usr/bin/python3 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: Platform: linux 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: brian version is: 2.2.2.1 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: numpy version is: 1.17.4 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: scipy version is: not installed 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: weave version is: not installed 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: sympy version is: 1.4 2019-11-30 15:53:10,242 DIAGNOSTIC brian2: python version is: 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] 2019-11-30 15:53:10,243 DEBUG brian2: Cache size for target "cython": 2 MB 2019-11-30 15:53:10,245 INFO brian2.devices.genn: The following preferences have been changed for Brian2GeNN, reset them manually if you use a different device later in the same script: codegen.loop_invariant_optimisations, core.network.default_schedule 2019-11-30 15:53:10,245 DIAGNOSTIC brian2.core.names: Created object of class Clock with name defaultclock 2019-11-30 15:53:10,245 DIAGNOSTIC brian2.core.clocks: Created clock defaultclock with dt=0.0001 2019-11-30 15:53:10,245 DIAGNOSTIC brian2.core.names: Created object of class Clock with name defaultclock 2019-11-30 15:53:10,246 DIAGNOSTIC brian2.core.clocks: Created clock defaultclock with dt=0.0001 2019-11-30 15:53:10,246 DIAGNOSTIC brian2.core.names: Created object of class NeuronGroup with name neurongroup 2019-11-30 15:53:10,246 DIAGNOSTIC brian2.core.base: Created BrianObject with name neurongroup, clock=Clock(dt=100. * usecond, name='defaultclock'), when=start, order=0 2019-11-30 15:53:10,249 DIAGNOSTIC brian2.groups.neurongroup: Creating NeuronGroup of size 1000, equations dv/dt = (0-v)/tau : 1. 2019-11-30 15:53:10,249 DIAGNOSTIC brian2.core.names: Created object of class Thresholder with name neurongroup_thresholder 2019-11-30 15:53:10,250 DIAGNOSTIC brian2.core.base: Created BrianObject with name neurongroup_thresholder, clock=Clock(dt=100. * usecond, name='defaultclock'), when=thresholds, order=0 2019-11-30 15:53:10,250 DIAGNOSTIC brian2.core.names: Created object of class Resetter with name neurongroup_resetter 2019-11-30 15:53:10,250 DIAGNOSTIC brian2.core.base: Created BrianObject with name neurongroup_resetter, clock=Clock(dt=100. * usecond, name='defaultclock'), when=resets, order=0 2019-11-30 15:53:10,250 DIAGNOSTIC brian2.core.names: Created object of class StateUpdater with name neurongroup_stateupdater 2019-11-30 15:53:10,250 DIAGNOSTIC brian2.core.base: Created BrianObject with name neurongroup_stateupdater, clock=Clock(dt=100. * usecond, name='defaultclock'), when=groups, order=0 2019-11-30 15:53:10,250 DIAGNOSTIC brian2.core.names: Created object of class SpikeMonitor with name spikemonitor 2019-11-30 15:53:10,251 DIAGNOSTIC brian2.core.base: Created BrianObject with name spikemonitor, clock=Clock(dt=100. * usecond, name='defaultclock'), when=thresholds, order=1 2019-11-30 15:53:10,254 DEBUG brian2.core.magic.magic_objects: Updated MagicNetwork to include 5 objects with names neurongroup_resetter, spikemonitor, neurongroup_thresholder, neurongroup, neurongroup_stateupdater 2019-11-30 15:53:10,254 DIAGNOSTIC brian2.core.clocks: Setting Clock defaultclock to t=, dt=0.0001 2019-11-30 15:53:10,254 DEBUG brian2.core.network.before_run: Preparing network magicnetwork with 5 objects: neurongroup, neurongroup_stateupdater, neurongroup_thresholder, spikemonitor, neurongroup_resetter 2019-11-30 15:53:10,269 DEBUG brian2.stateupdaters.base.method_choice: Group neurongroup: using numerical integration method exact (took 0.01s) 2019-11-30 15:53:10,269 DIAGNOSTIC brian2.codegen.codeobject: Creating code object (group=neurongroup, template name=stateupdate) for abstract code: _v = v*exp(-dt/tau) v = _v 2019-11-30 15:53:10,274 DIAGNOSTIC brian2.codegen.codeobject: Creating code object (group=neurongroup, template name=threshold) for abstract code: _cond = v>1 2019-11-30 15:53:10,276 DIAGNOSTIC brian2.codegen.codeobject: Creating code object (group=spikemonitor, template name=spikemonitor) for abstract code: _to_record_t = _source_t _to_record_i = _source_i 2019-11-30 15:53:10,283 DIAGNOSTIC brian2.devices.device: spikemonitor_codeobject abstract code: _to_record_t = _source_t _to_record_i = _source_i 2019-11-30 15:53:10,283 DIAGNOSTIC brian2.devices.device: spikemonitor_codeobject snippet (scalar): const double _source_t = _ptr_array_defaultclock_t[0]; 2019-11-30 15:53:10,283 DIAGNOSTIC brian2.devices.device: spikemonitor_codeobject snippet (vector): const int32_t _source_i = _ptr_array_neurongroup_i[_idx]; const double _to_record_t = _source_t; const int32_t _to_record_i = _source_i; 2019-11-30 15:53:10,288 DIAGNOSTIC brian2.devices.device: spikemonitor_codeobject code: h_file: #ifndef _INCLUDED_spikemonitor_codeobject #define _INCLUDED_spikemonitor_codeobject #include "objects.h" void _run_spikemonitor_codeobject(); #endif cpp_file: #include "code_objects/spikemonitor_codeobject.h" #include "brianlib/common_math.h" #include "brianlib/stdint_compat.h" #include #include #include #include #include extern double t; extern int which; #include "sparseProjection.h" #include "magicnetwork_model_CODE/definitions.h" extern unsigned int *glbSpkCntneurongroup; extern unsigned int *glbSpkneurongroup; ////// SUPPORT CODE /////// namespace { template < typename T1, typename T2 > struct _higher_type; template < > struct _higher_type { typedef int type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < typename T1, typename T2 > static inline typename _higher_type::type _brian_mod(T1 x, T2 y) {{ return x-y*floor(1.0*x/y); }} template < typename T1, typename T2 > static inline typename _higher_type::type _brian_floordiv(T1 x, T2 y) {{ return floor(1.0*x/y); }} #ifdef _MSC_VER #define _brian_pow(x, y) (pow((double)(x), (y))) #else #define _brian_pow(x, y) (pow((x), (y))) #endif } ////// HASH DEFINES /////// void _run_spikemonitor_codeobject() { using namespace brian; ///// CONSTANTS /////////// %CONSTANTS% ///// POINTERS //////////// int32_t* _ptr_array_spikemonitor_N = _array_spikemonitor_N; int32_t* __restrict _ptr_array_neurongroup_i = _array_neurongroup_i; double* __restrict _ptr_array_spikemonitor_t = _array_spikemonitor_t; int32_t* __restrict _ptr_array_spikemonitor_count = _array_spikemonitor_count; int32_t* __restrict _ptr_array_neurongroup__spikespace = _array_neurongroup__spikespace; int32_t* __restrict _ptr_array_spikemonitor_i = _array_spikemonitor_i; double* _ptr_array_defaultclock_t = _array_defaultclock_t; int32_t* __restrict _ptr_array_spikemonitor__source_idx = _array_spikemonitor__source_idx; //// MAIN CODE //////////// int32_t _num_events = spikeCount_neurongroup; #ifndef CPU_ONLY if (which == 1) { // need to pull monitored data from GPU } #endif if (_num_events > 0) { unsigned int _true_events= 0; for(int _j=0; _j<_num_events; _j++) { const int _idx = spike_neurongroup[_j]; if ((_idx >= _source_start) && (_idx < _source_stop)) { _dynamic_array_spikemonitor_t.push_back(t); _dynamic_array_spikemonitor_i.push_back(_idx - _source_start); _ptr_array_spikemonitor_count[_idx-_source_start]++; _true_events++; } } _ptr_array_spikemonitor_N[0] += _true_events; } } 2019-11-30 15:53:10,288 DIAGNOSTIC brian2.core.names: Created object of class GeNNUserCodeObject with name spikemonitor_codeobject 2019-11-30 15:53:10,288 DIAGNOSTIC brian2.codegen.codeobject: Creating code object (group=neurongroup, template name=reset) for abstract code: v = 0 2019-11-30 15:53:10,290 DEBUG brian2.core.network.before_run: Network magicnetwork uses 1 clocks: defaultclock (dt=100. us) 2019-11-30 15:53:10,290 DEBUG brian2.devices.genn: Writing GeNN project to directory GeNNworkspace 2019-11-30 15:53:10,290 DEBUG brian2.devices.genn: static arrays: [] 2019-11-30 15:53:10,293 DIAGNOSTIC brian2.devices.device: neurongroup_stateupdater abstract code: Key stateupdate: _v = v*exp(-dt/tau) v = _v _cond = v>1 Key reset: v = 0 Key subexpression_update: Key run_regularly: Key poisson_input: 2019-11-30 15:53:10,295 DIAGNOSTIC brian2.devices.device: neurongroup_stateupdater snippet (scalar): Key stateupdate: Key reset: Key subexpression_update: Key run_regularly: Key poisson_input: 2019-11-30 15:53:10,295 DIAGNOSTIC brian2.devices.device: neurongroup_stateupdater snippet (vector): Key stateupdate: double _v = v * exp(1.0f*(- dt)/tau); v = _v; char _cond = v > 1; Key reset: v = 0; Key subexpression_update: Key run_regularly: Key poisson_input: 2019-11-30 15:53:10,295 DIAGNOSTIC brian2.devices.device: neurongroup_stateupdater code: h_file: template < typename T1, typename T2 > struct _higher_type; template < > struct _higher_type { typedef int type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < typename T1, typename T2 > #ifdef CPU_ONLY static inline typename _higher_type::type #else __host__ __device__ static inline typename _higher_type::type #endif _brian_mod(T1 x, T2 y) {{ return x-y*floor(1.0*x/y); }} template < typename T1, typename T2 > #ifdef CPU_ONLY static inline typename _higher_type::type #else __host__ __device__ static inline typename _higher_type::type #endif _brian_floordiv(T1 x, T2 y) {{ return floor(1.0*x/y); }} #ifdef _MSC_VER #define _brian_pow(x, y) (pow((double)(x), (y))) #else #define _brian_pow(x, y) (pow((x), (y))) #endif reset_code: v = 0; stateupdate_code: // Update "constant over dt" subexpressions (if any) // PoissonInputs targetting this group (if any) // Update state variables and the threshold condition double _v = v * exp(1.0f*(- dt)/tau); v = _v; char _cond = v > 1; 2019-11-30 15:53:10,295 DIAGNOSTIC brian2.core.names: Created object of class GeNNCodeObject with name neurongroup_stateupdater 2019-11-30 15:53:10,296 DIAGNOSTIC brian2.devices.genn: Writing file network.*: h_file: #ifndef _BRIAN_NETWORK_H #define _BRIAN_NETWORK_H class Network { public: static double _last_run_time; static double _last_run_completed_fraction; }; #endif cpp_file: 2019-11-30 15:53:10,296 DIAGNOSTIC brian2.devices.genn: Writing file network.cpp: 2019-11-30 15:53:10,296 DIAGNOSTIC brian2.devices.genn: Writing file network.h: #ifndef _BRIAN_NETWORK_H #define _BRIAN_NETWORK_H class Network { public: static double _last_run_time; static double _last_run_completed_fraction; }; #endif 2019-11-30 15:53:10,324 DIAGNOSTIC brian2.devices.genn: Writing file objects.*: h_file: #ifndef _BRIAN_OBJECTS_H #define _BRIAN_OBJECTS_H #include "synapses_classes.h" #include "brianlib/clocks.h" #include "brianlib/dynamic_array.h" #include "brianlib/stdint_compat.h" #include "network.h" #include "randomkit.h" #include namespace brian { // In OpenMP we need one state per thread extern std::vector< rk_state* > _mersenne_twister_states; //////////////// clocks /////////////////// extern Clock defaultclock; //////////////// networks ///////////////// //////////////// dynamic arrays /////////// extern std::vector _dynamic_array_spikemonitor_i; extern std::vector _dynamic_array_spikemonitor_t; //////////////// arrays /////////////////// extern double *_array_defaultclock_dt; extern const int _num__array_defaultclock_dt; extern double *_array_defaultclock_t; extern const int _num__array_defaultclock_t; extern int64_t *_array_defaultclock_timestep; extern const int _num__array_defaultclock_timestep; extern int32_t *_array_neurongroup__spikespace; extern const int _num__array_neurongroup__spikespace; extern int32_t *_array_neurongroup_i; extern const int _num__array_neurongroup_i; extern double *_array_neurongroup_v; extern const int _num__array_neurongroup_v; extern int32_t *_array_spikemonitor__source_idx; extern const int _num__array_spikemonitor__source_idx; extern int32_t *_array_spikemonitor_count; extern const int _num__array_spikemonitor_count; extern int32_t *_array_spikemonitor_N; extern const int _num__array_spikemonitor_N; //////////////// dynamic arrays 2d ///////// /////////////// static arrays ///////////// //////////////// synapses ///////////////// } void _init_arrays(); void _load_arrays(); void _write_arrays(); void _dealloc_arrays(); #endif cpp_file: #include "objects.h" #include "synapses_classes.h" #include "brianlib/clocks.h" #include "brianlib/dynamic_array.h" #include "brianlib/stdint_compat.h" #include "network.h" #include "randomkit.h" #include #include #include namespace brian { std::vector< rk_state* > _mersenne_twister_states; //////////////// networks ///////////////// //////////////// arrays /////////////////// double * _array_defaultclock_dt; const int _num__array_defaultclock_dt = 1; double * _array_defaultclock_t; const int _num__array_defaultclock_t = 1; int64_t * _array_defaultclock_timestep; const int _num__array_defaultclock_timestep = 1; int32_t * _array_neurongroup__spikespace; const int _num__array_neurongroup__spikespace = 1001; int32_t * _array_neurongroup_i; const int _num__array_neurongroup_i = 1000; double * _array_neurongroup_v; const int _num__array_neurongroup_v = 1000; int32_t * _array_spikemonitor__source_idx; const int _num__array_spikemonitor__source_idx = 1000; int32_t * _array_spikemonitor_count; const int _num__array_spikemonitor_count = 1000; int32_t * _array_spikemonitor_N; const int _num__array_spikemonitor_N = 1; //////////////// dynamic arrays 1d ///////// std::vector _dynamic_array_spikemonitor_i; std::vector _dynamic_array_spikemonitor_t; //////////////// dynamic arrays 2d ///////// /////////////// static arrays ///////////// //////////////// synapses ///////////////// //////////////// clocks /////////////////// Clock defaultclock; // attributes will be set in run.cpp } void _init_arrays() { using namespace brian; // Arrays initialized to 0 _array_defaultclock_dt = new double[1]; for(int i=0; i<1; i++) _array_defaultclock_dt[i] = 0; _array_defaultclock_t = new double[1]; for(int i=0; i<1; i++) _array_defaultclock_t[i] = 0; _array_defaultclock_timestep = new int64_t[1]; for(int i=0; i<1; i++) _array_defaultclock_timestep[i] = 0; _array_neurongroup__spikespace = new int32_t[1001]; for(int i=0; i<1001; i++) _array_neurongroup__spikespace[i] = 0; _array_neurongroup_i = new int32_t[1000]; for(int i=0; i<1000; i++) _array_neurongroup_i[i] = 0; _array_neurongroup_v = new double[1000]; for(int i=0; i<1000; i++) _array_neurongroup_v[i] = 0; _array_spikemonitor__source_idx = new int32_t[1000]; for(int i=0; i<1000; i++) _array_spikemonitor__source_idx[i] = 0; _array_spikemonitor_count = new int32_t[1000]; for(int i=0; i<1000; i++) _array_spikemonitor_count[i] = 0; _array_spikemonitor_N = new int32_t[1]; for(int i=0; i<1; i++) _array_spikemonitor_N[i] = 0; // Arrays initialized to an "arange" _array_neurongroup_i = new int32_t[1000]; for(int i=0; i<1000; i++) _array_neurongroup_i[i] = 0 + i; _array_spikemonitor__source_idx = new int32_t[1000]; for(int i=0; i<1000; i++) _array_spikemonitor__source_idx[i] = 0 + i; // static arrays // Random number generator states for (int i=0; i<1; i++) _mersenne_twister_states.push_back(new rk_state()); } void _load_arrays() { using namespace brian; } void _write_arrays() { using namespace brian; ofstream outfile__array_defaultclock_dt; outfile__array_defaultclock_dt.open("results/_array_defaultclock_dt_-9204088106046589041", ios::binary | ios::out); if(outfile__array_defaultclock_dt.is_open()) { outfile__array_defaultclock_dt.write(reinterpret_cast(_array_defaultclock_dt), 1*sizeof(_array_defaultclock_dt[0])); outfile__array_defaultclock_dt.close(); } else { std::cout << "Error writing output file for _array_defaultclock_dt." << endl; } ofstream outfile__array_defaultclock_t; outfile__array_defaultclock_t.open("results/_array_defaultclock_t_1864067533182436010", ios::binary | ios::out); if(outfile__array_defaultclock_t.is_open()) { outfile__array_defaultclock_t.write(reinterpret_cast(_array_defaultclock_t), 1*sizeof(_array_defaultclock_t[0])); outfile__array_defaultclock_t.close(); } else { std::cout << "Error writing output file for _array_defaultclock_t." << endl; } ofstream outfile__array_defaultclock_timestep; outfile__array_defaultclock_timestep.open("results/_array_defaultclock_timestep_4444439366781034914", ios::binary | ios::out); if(outfile__array_defaultclock_timestep.is_open()) { outfile__array_defaultclock_timestep.write(reinterpret_cast(_array_defaultclock_timestep), 1*sizeof(_array_defaultclock_timestep[0])); outfile__array_defaultclock_timestep.close(); } else { std::cout << "Error writing output file for _array_defaultclock_timestep." << endl; } ofstream outfile__array_neurongroup__spikespace; outfile__array_neurongroup__spikespace.open("results/_array_neurongroup__spikespace_-4597185639791106948", ios::binary | ios::out); if(outfile__array_neurongroup__spikespace.is_open()) { outfile__array_neurongroup__spikespace.write(reinterpret_cast(_array_neurongroup__spikespace), 1001*sizeof(_array_neurongroup__spikespace[0])); outfile__array_neurongroup__spikespace.close(); } else { std::cout << "Error writing output file for _array_neurongroup__spikespace." << endl; } ofstream outfile__array_neurongroup_i; outfile__array_neurongroup_i.open("results/_array_neurongroup_i_4547112559703268842", ios::binary | ios::out); if(outfile__array_neurongroup_i.is_open()) { outfile__array_neurongroup_i.write(reinterpret_cast(_array_neurongroup_i), 1000*sizeof(_array_neurongroup_i[0])); outfile__array_neurongroup_i.close(); } else { std::cout << "Error writing output file for _array_neurongroup_i." << endl; } ofstream outfile__array_neurongroup_v; outfile__array_neurongroup_v.open("results/_array_neurongroup_v_6807741097744385456", ios::binary | ios::out); if(outfile__array_neurongroup_v.is_open()) { outfile__array_neurongroup_v.write(reinterpret_cast(_array_neurongroup_v), 1000*sizeof(_array_neurongroup_v[0])); outfile__array_neurongroup_v.close(); } else { std::cout << "Error writing output file for _array_neurongroup_v." << endl; } ofstream outfile__array_spikemonitor__source_idx; outfile__array_spikemonitor__source_idx.open("results/_array_spikemonitor__source_idx_-3075594179432880676", ios::binary | ios::out); if(outfile__array_spikemonitor__source_idx.is_open()) { outfile__array_spikemonitor__source_idx.write(reinterpret_cast(_array_spikemonitor__source_idx), 1000*sizeof(_array_spikemonitor__source_idx[0])); outfile__array_spikemonitor__source_idx.close(); } else { std::cout << "Error writing output file for _array_spikemonitor__source_idx." << endl; } ofstream outfile__array_spikemonitor_count; outfile__array_spikemonitor_count.open("results/_array_spikemonitor_count_2496547936547115699", ios::binary | ios::out); if(outfile__array_spikemonitor_count.is_open()) { outfile__array_spikemonitor_count.write(reinterpret_cast(_array_spikemonitor_count), 1000*sizeof(_array_spikemonitor_count[0])); outfile__array_spikemonitor_count.close(); } else { std::cout << "Error writing output file for _array_spikemonitor_count." << endl; } ofstream outfile__array_spikemonitor_N; outfile__array_spikemonitor_N.open("results/_array_spikemonitor_N_-4211159109691831692", ios::binary | ios::out); if(outfile__array_spikemonitor_N.is_open()) { outfile__array_spikemonitor_N.write(reinterpret_cast(_array_spikemonitor_N), 1*sizeof(_array_spikemonitor_N[0])); outfile__array_spikemonitor_N.close(); } else { std::cout << "Error writing output file for _array_spikemonitor_N." << endl; } ofstream outfile__dynamic_array_spikemonitor_i; outfile__dynamic_array_spikemonitor_i.open("results/_dynamic_array_spikemonitor_i_7516093757922403560", ios::binary | ios::out); if(outfile__dynamic_array_spikemonitor_i.is_open()) { if (! _dynamic_array_spikemonitor_i.empty() ) { outfile__dynamic_array_spikemonitor_i.write(reinterpret_cast(&_dynamic_array_spikemonitor_i[0]), _dynamic_array_spikemonitor_i.size()*sizeof(_dynamic_array_spikemonitor_i[0])); outfile__dynamic_array_spikemonitor_i.close(); } } else { std::cout << "Error writing output file for _dynamic_array_spikemonitor_i." << endl; } ofstream outfile__dynamic_array_spikemonitor_t; outfile__dynamic_array_spikemonitor_t.open("results/_dynamic_array_spikemonitor_t_4128613688637833733", ios::binary | ios::out); if(outfile__dynamic_array_spikemonitor_t.is_open()) { if (! _dynamic_array_spikemonitor_t.empty() ) { outfile__dynamic_array_spikemonitor_t.write(reinterpret_cast(&_dynamic_array_spikemonitor_t[0]), _dynamic_array_spikemonitor_t.size()*sizeof(_dynamic_array_spikemonitor_t[0])); outfile__dynamic_array_spikemonitor_t.close(); } } else { std::cout << "Error writing output file for _dynamic_array_spikemonitor_t." << endl; } // Write last run info to disk ofstream outfile_last_run_info; outfile_last_run_info.open("results/last_run_info.txt", ios::out); if(outfile_last_run_info.is_open()) { outfile_last_run_info << (Network::_last_run_time) << " " << (Network::_last_run_completed_fraction) << std::endl; outfile_last_run_info.close(); } else { std::cout << "Error writing last run info to file." << std::endl; } } void _dealloc_arrays() { using namespace brian; // static arrays } 2019-11-30 15:53:10,324 DIAGNOSTIC brian2.devices.genn: Writing file objects.cpp: #include "objects.h" #include "synapses_classes.h" #include "brianlib/clocks.h" #include "brianlib/dynamic_array.h" #include "brianlib/stdint_compat.h" #include "network.h" #include "randomkit.h" #include #include #include namespace brian { std::vector< rk_state* > _mersenne_twister_states; //////////////// networks ///////////////// //////////////// arrays /////////////////// double * _array_defaultclock_dt; const int _num__array_defaultclock_dt = 1; double * _array_defaultclock_t; const int _num__array_defaultclock_t = 1; int64_t * _array_defaultclock_timestep; const int _num__array_defaultclock_timestep = 1; int32_t * _array_neurongroup__spikespace; const int _num__array_neurongroup__spikespace = 1001; int32_t * _array_neurongroup_i; const int _num__array_neurongroup_i = 1000; double * _array_neurongroup_v; const int _num__array_neurongroup_v = 1000; int32_t * _array_spikemonitor__source_idx; const int _num__array_spikemonitor__source_idx = 1000; int32_t * _array_spikemonitor_count; const int _num__array_spikemonitor_count = 1000; int32_t * _array_spikemonitor_N; const int _num__array_spikemonitor_N = 1; //////////////// dynamic arrays 1d ///////// std::vector _dynamic_array_spikemonitor_i; std::vector _dynamic_array_spikemonitor_t; //////////////// dynamic arrays 2d ///////// /////////////// static arrays ///////////// //////////////// synapses ///////////////// //////////////// clocks /////////////////// Clock defaultclock; // attributes will be set in run.cpp } void _init_arrays() { using namespace brian; // Arrays initialized to 0 _array_defaultclock_dt = new double[1]; for(int i=0; i<1; i++) _array_defaultclock_dt[i] = 0; _array_defaultclock_t = new double[1]; for(int i=0; i<1; i++) _array_defaultclock_t[i] = 0; _array_defaultclock_timestep = new int64_t[1]; for(int i=0; i<1; i++) _array_defaultclock_timestep[i] = 0; _array_neurongroup__spikespace = new int32_t[1001]; for(int i=0; i<1001; i++) _array_neurongroup__spikespace[i] = 0; _array_neurongroup_i = new int32_t[1000]; for(int i=0; i<1000; i++) _array_neurongroup_i[i] = 0; _array_neurongroup_v = new double[1000]; for(int i=0; i<1000; i++) _array_neurongroup_v[i] = 0; _array_spikemonitor__source_idx = new int32_t[1000]; for(int i=0; i<1000; i++) _array_spikemonitor__source_idx[i] = 0; _array_spikemonitor_count = new int32_t[1000]; for(int i=0; i<1000; i++) _array_spikemonitor_count[i] = 0; _array_spikemonitor_N = new int32_t[1]; for(int i=0; i<1; i++) _array_spikemonitor_N[i] = 0; // Arrays initialized to an "arange" _array_neurongroup_i = new int32_t[1000]; for(int i=0; i<1000; i++) _array_neurongroup_i[i] = 0 + i; _array_spikemonitor__source_idx = new int32_t[1000]; for(int i=0; i<1000; i++) _array_spikemonitor__source_idx[i] = 0 + i; // static arrays // Random number generator states for (int i=0; i<1; i++) _mersenne_twister_states.push_back(new rk_state()); } void _load_arrays() { using namespace brian; } void _write_arrays() { using namespace brian; ofstream outfile__array_defaultclock_dt; outfile__array_defaultclock_dt.open("results/_array_defaultclock_dt_-9204088106046589041", ios::binary | ios::out); if(outfile__array_defaultclock_dt.is_open()) { outfile__array_defaultclock_dt.write(reinterpret_cast(_array_defaultclock_dt), 1*sizeof(_array_defaultclock_dt[0])); outfile__array_defaultclock_dt.close(); } else { std::cout << "Error writing output file for _array_defaultclock_dt." << endl; } ofstream outfile__array_defaultclock_t; outfile__array_defaultclock_t.open("results/_array_defaultclock_t_1864067533182436010", ios::binary | ios::out); if(outfile__array_defaultclock_t.is_open()) { outfile__array_defaultclock_t.write(reinterpret_cast(_array_defaultclock_t), 1*sizeof(_array_defaultclock_t[0])); outfile__array_defaultclock_t.close(); } else { std::cout << "Error writing output file for _array_defaultclock_t." << endl; } ofstream outfile__array_defaultclock_timestep; outfile__array_defaultclock_timestep.open("results/_array_defaultclock_timestep_4444439366781034914", ios::binary | ios::out); if(outfile__array_defaultclock_timestep.is_open()) { outfile__array_defaultclock_timestep.write(reinterpret_cast(_array_defaultclock_timestep), 1*sizeof(_array_defaultclock_timestep[0])); outfile__array_defaultclock_timestep.close(); } else { std::cout << "Error writing output file for _array_defaultclock_timestep." << endl; } ofstream outfile__array_neurongroup__spikespace; outfile__array_neurongroup__spikespace.open("results/_array_neurongroup__spikespace_-4597185639791106948", ios::binary | ios::out); if(outfile__array_neurongroup__spikespace.is_open()) { outfile__array_neurongroup__spikespace.write(reinterpret_cast(_array_neurongroup__spikespace), 1001*sizeof(_array_neurongroup__spikespace[0])); outfile__array_neurongroup__spikespace.close(); } else { std::cout << "Error writing output file for _array_neurongroup__spikespace." << endl; } ofstream outfile__array_neurongroup_i; outfile__array_neurongroup_i.open("results/_array_neurongroup_i_4547112559703268842", ios::binary | ios::out); if(outfile__array_neurongroup_i.is_open()) { outfile__array_neurongroup_i.write(reinterpret_cast(_array_neurongroup_i), 1000*sizeof(_array_neurongroup_i[0])); outfile__array_neurongroup_i.close(); } else { std::cout << "Error writing output file for _array_neurongroup_i." << endl; } ofstream outfile__array_neurongroup_v; outfile__array_neurongroup_v.open("results/_array_neurongroup_v_6807741097744385456", ios::binary | ios::out); if(outfile__array_neurongroup_v.is_open()) { outfile__array_neurongroup_v.write(reinterpret_cast(_array_neurongroup_v), 1000*sizeof(_array_neurongroup_v[0])); outfile__array_neurongroup_v.close(); } else { std::cout << "Error writing output file for _array_neurongroup_v." << endl; } ofstream outfile__array_spikemonitor__source_idx; outfile__array_spikemonitor__source_idx.open("results/_array_spikemonitor__source_idx_-3075594179432880676", ios::binary | ios::out); if(outfile__array_spikemonitor__source_idx.is_open()) { outfile__array_spikemonitor__source_idx.write(reinterpret_cast(_array_spikemonitor__source_idx), 1000*sizeof(_array_spikemonitor__source_idx[0])); outfile__array_spikemonitor__source_idx.close(); } else { std::cout << "Error writing output file for _array_spikemonitor__source_idx." << endl; } ofstream outfile__array_spikemonitor_count; outfile__array_spikemonitor_count.open("results/_array_spikemonitor_count_2496547936547115699", ios::binary | ios::out); if(outfile__array_spikemonitor_count.is_open()) { outfile__array_spikemonitor_count.write(reinterpret_cast(_array_spikemonitor_count), 1000*sizeof(_array_spikemonitor_count[0])); outfile__array_spikemonitor_count.close(); } else { std::cout << "Error writing output file for _array_spikemonitor_count." << endl; } ofstream outfile__array_spikemonitor_N; outfile__array_spikemonitor_N.open("results/_array_spikemonitor_N_-4211159109691831692", ios::binary | ios::out); if(outfile__array_spikemonitor_N.is_open()) { outfile__array_spikemonitor_N.write(reinterpret_cast(_array_spikemonitor_N), 1*sizeof(_array_spikemonitor_N[0])); outfile__array_spikemonitor_N.close(); } else { std::cout << "Error writing output file for _array_spikemonitor_N." << endl; } ofstream outfile__dynamic_array_spikemonitor_i; outfile__dynamic_array_spikemonitor_i.open("results/_dynamic_array_spikemonitor_i_7516093757922403560", ios::binary | ios::out); if(outfile__dynamic_array_spikemonitor_i.is_open()) { if (! _dynamic_array_spikemonitor_i.empty() ) { outfile__dynamic_array_spikemonitor_i.write(reinterpret_cast(&_dynamic_array_spikemonitor_i[0]), _dynamic_array_spikemonitor_i.size()*sizeof(_dynamic_array_spikemonitor_i[0])); outfile__dynamic_array_spikemonitor_i.close(); } } else { std::cout << "Error writing output file for _dynamic_array_spikemonitor_i." << endl; } ofstream outfile__dynamic_array_spikemonitor_t; outfile__dynamic_array_spikemonitor_t.open("results/_dynamic_array_spikemonitor_t_4128613688637833733", ios::binary | ios::out); if(outfile__dynamic_array_spikemonitor_t.is_open()) { if (! _dynamic_array_spikemonitor_t.empty() ) { outfile__dynamic_array_spikemonitor_t.write(reinterpret_cast(&_dynamic_array_spikemonitor_t[0]), _dynamic_array_spikemonitor_t.size()*sizeof(_dynamic_array_spikemonitor_t[0])); outfile__dynamic_array_spikemonitor_t.close(); } } else { std::cout << "Error writing output file for _dynamic_array_spikemonitor_t." << endl; } // Write last run info to disk ofstream outfile_last_run_info; outfile_last_run_info.open("results/last_run_info.txt", ios::out); if(outfile_last_run_info.is_open()) { outfile_last_run_info << (Network::_last_run_time) << " " << (Network::_last_run_completed_fraction) << std::endl; outfile_last_run_info.close(); } else { std::cout << "Error writing last run info to file." << std::endl; } } void _dealloc_arrays() { using namespace brian; // static arrays } 2019-11-30 15:53:10,324 DIAGNOSTIC brian2.devices.genn: Writing file objects.h: #ifndef _BRIAN_OBJECTS_H #define _BRIAN_OBJECTS_H #include "synapses_classes.h" #include "brianlib/clocks.h" #include "brianlib/dynamic_array.h" #include "brianlib/stdint_compat.h" #include "network.h" #include "randomkit.h" #include namespace brian { // In OpenMP we need one state per thread extern std::vector< rk_state* > _mersenne_twister_states; //////////////// clocks /////////////////// extern Clock defaultclock; //////////////// networks ///////////////// //////////////// dynamic arrays /////////// extern std::vector _dynamic_array_spikemonitor_i; extern std::vector _dynamic_array_spikemonitor_t; //////////////// arrays /////////////////// extern double *_array_defaultclock_dt; extern const int _num__array_defaultclock_dt; extern double *_array_defaultclock_t; extern const int _num__array_defaultclock_t; extern int64_t *_array_defaultclock_timestep; extern const int _num__array_defaultclock_timestep; extern int32_t *_array_neurongroup__spikespace; extern const int _num__array_neurongroup__spikespace; extern int32_t *_array_neurongroup_i; extern const int _num__array_neurongroup_i; extern double *_array_neurongroup_v; extern const int _num__array_neurongroup_v; extern int32_t *_array_spikemonitor__source_idx; extern const int _num__array_spikemonitor__source_idx; extern int32_t *_array_spikemonitor_count; extern const int _num__array_spikemonitor_count; extern int32_t *_array_spikemonitor_N; extern const int _num__array_spikemonitor_N; //////////////// dynamic arrays 2d ///////// /////////////// static arrays ///////////// //////////////// synapses ///////////////// } void _init_arrays(); void _load_arrays(); void _write_arrays(); void _dealloc_arrays(); #endif 2019-11-30 15:53:10,325 DIAGNOSTIC brian2.devices.genn: Writing file code_objects/spikemonitor_codeobject.cpp: #include "objects.h" #include "code_objects/spikemonitor_codeobject.h" #include "brianlib/common_math.h" #include "brianlib/stdint_compat.h" #include #include #include #include #include extern double t; extern int which; #include "sparseProjection.h" #include "magicnetwork_model_CODE/definitions.h" extern unsigned int *glbSpkCntneurongroup; extern unsigned int *glbSpkneurongroup; ////// SUPPORT CODE /////// namespace { template < typename T1, typename T2 > struct _higher_type; template < > struct _higher_type { typedef int type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef long long type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef float type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < > struct _higher_type { typedef long double type; }; template < typename T1, typename T2 > static inline typename _higher_type::type _brian_mod(T1 x, T2 y) {{ return x-y*floor(1.0*x/y); }} template < typename T1, typename T2 > static inline typename _higher_type::type _brian_floordiv(T1 x, T2 y) {{ return floor(1.0*x/y); }} #ifdef _MSC_VER #define _brian_pow(x, y) (pow((double)(x), (y))) #else #define _brian_pow(x, y) (pow((x), (y))) #endif } ////// HASH DEFINES /////// void _run_spikemonitor_codeobject() { using namespace brian; ///// CONSTANTS /////////// const int _numN = 1; const int _num_source_i = 1000; double* const _array_spikemonitor_t = &_dynamic_array_spikemonitor_t[0]; const int _numt = _dynamic_array_spikemonitor_t.size(); const int _numcount = 1000; const int _num_spikespace = 1001; int32_t* const _array_spikemonitor_i = &_dynamic_array_spikemonitor_i[0]; const int _numi = _dynamic_array_spikemonitor_i.size(); const int _num_clock_t = 1; const int _num_source_t = 1; const int _num_source_idx = 1000; ///// POINTERS //////////// int32_t* _ptr_array_spikemonitor_N = _array_spikemonitor_N; int32_t* __restrict _ptr_array_neurongroup_i = _array_neurongroup_i; double* __restrict _ptr_array_spikemonitor_t = _array_spikemonitor_t; int32_t* __restrict _ptr_array_spikemonitor_count = _array_spikemonitor_count; int32_t* __restrict _ptr_array_neurongroup__spikespace = _array_neurongroup__spikespace; int32_t* __restrict _ptr_array_spikemonitor_i = _array_spikemonitor_i; double* _ptr_array_defaultclock_t = _array_defaultclock_t; int32_t* __restrict _ptr_array_spikemonitor__source_idx = _array_spikemonitor__source_idx; //// MAIN CODE //////////// int32_t _num_events = spikeCount_neurongroup; #ifndef CPU_ONLY if (which == 1) { // need to pull monitored data from GPU } #endif if (_num_events > 0) { unsigned int _true_events= 0; for(int _j=0; _j<_num_events; _j++) { const int _idx = spike_neurongroup[_j]; if ((_idx >= 0) && (_idx < 1000)) { _dynamic_array_spikemonitor_t.push_back(t); _dynamic_array_spikemonitor_i.push_back(_idx - 0); _ptr_array_spikemonitor_count[_idx-0]++; _true_events++; } } _ptr_array_spikemonitor_N[0] += _true_events; } } 2019-11-30 15:53:10,325 DIAGNOSTIC brian2.devices.genn: Writing file code_objects/spikemonitor_codeobject.h: #ifndef _INCLUDED_spikemonitor_codeobject #define _INCLUDED_spikemonitor_codeobject #include "objects.h" void _run_spikemonitor_codeobject(); #endif 2019-11-30 15:53:10,329 DIAGNOSTIC brian2.devices.genn: Writing file synapses_classes.*: h_file: #ifndef _BRIAN_SYNAPSES_H #define _BRIAN_SYNAPSES_H #include #include #include "brianlib/spikequeue.h" class SynapticPathway { public: int Nsource, Ntarget, _nb_threads; std::vector &sources; std::vector all_peek; std::vector< CSpikeQueue * > queue; SynapticPathway(std::vector &_sources, int _spikes_start, int _spikes_stop) : sources(_sources) { _nb_threads = 1; for (int _idx=0; _idx < _nb_threads; _idx++) queue.push_back(new CSpikeQueue(_spikes_start, _spikes_stop)); }; ~SynapticPathway() { for (int _idx=0; _idx < _nb_threads; _idx++) delete(queue[_idx]); } void push(int *spikes, int nspikes) { queue[0]->push(spikes, nspikes); } void advance() { queue[0]->advance(); } vector* peek() { for(int _thread=0; _thread < 1; _thread++) { { if (_thread == 0) all_peek.clear(); all_peek.insert(all_peek.end(), queue[_thread]->peek()->begin(), queue[_thread]->peek()->end()); } } return &all_peek; } template void prepare(int n_source, int n_target, scalar *real_delays, int n_delays, int *sources, int n_synapses, double _dt) { Nsource = n_source; Ntarget = n_target; { int length; if (0 == _nb_threads - 1) length = n_synapses - (int)0*(n_synapses/_nb_threads); else length = (int) n_synapses/_nb_threads; int padding = 0*(n_synapses/_nb_threads); queue[0]->openmp_padding = padding; if (n_delays > 1) queue[0]->prepare(&real_delays[padding], length, &sources[padding], length, _dt); else if (n_delays == 1) queue[0]->prepare(&real_delays[0], 1, &sources[padding], length, _dt); else // no synapses queue[0]->prepare((scalar *)NULL, 0, &sources[padding], length, _dt); } } }; #endif cpp_file: 2019-11-30 15:53:10,329 DIAGNOSTIC brian2.devices.genn: Writing file synapses_classes.cpp: 2019-11-30 15:53:10,329 DIAGNOSTIC brian2.devices.genn: Writing file synapses_classes.h: #ifndef _BRIAN_SYNAPSES_H #define _BRIAN_SYNAPSES_H #include #include #include "brianlib/spikequeue.h" class SynapticPathway { public: int Nsource, Ntarget, _nb_threads; std::vector &sources; std::vector all_peek; std::vector< CSpikeQueue * > queue; SynapticPathway(std::vector &_sources, int _spikes_start, int _spikes_stop) : sources(_sources) { _nb_threads = 1; for (int _idx=0; _idx < _nb_threads; _idx++) queue.push_back(new CSpikeQueue(_spikes_start, _spikes_stop)); }; ~SynapticPathway() { for (int _idx=0; _idx < _nb_threads; _idx++) delete(queue[_idx]); } void push(int *spikes, int nspikes) { queue[0]->push(spikes, nspikes); } void advance() { queue[0]->advance(); } vector* peek() { for(int _thread=0; _thread < 1; _thread++) { { if (_thread == 0) all_peek.clear(); all_peek.insert(all_peek.end(), queue[_thread]->peek()->begin(), queue[_thread]->peek()->end()); } } return &all_peek; } template void prepare(int n_source, int n_target, scalar *real_delays, int n_delays, int *sources, int n_synapses, double _dt) { Nsource = n_source; Ntarget = n_target; { int length; if (0 == _nb_threads - 1) length = n_synapses - (int)0*(n_synapses/_nb_threads); else length = (int) n_synapses/_nb_threads; int padding = 0*(n_synapses/_nb_threads); queue[0]->openmp_padding = padding; if (n_delays > 1) queue[0]->prepare(&real_delays[padding], length, &sources[padding], length, _dt); else if (n_delays == 1) queue[0]->prepare(&real_delays[0], 1, &sources[padding], length, _dt); else // no synapses queue[0]->prepare((scalar *)NULL, 0, &sources[padding], length, _dt); } } }; #endif 2019-11-30 15:53:10,350 DIAGNOSTIC brian2.devices.genn: Writing file magicnetwork_model.cpp: // define the time step #include #include "modelSpec.h" //-------------------------------------------------------------------------- /*! \brief This function defines the Brian2GeNN_model */ //-------------------------------------------------------------------------- // // define the neuron model classes class neurongroupNEURON : public NeuronModels::Base { public: DECLARE_MODEL(neurongroupNEURON, 1, 2); SET_SIM_CODE("// Update \"constant over DT\" subexpressions (if any)\n\ \n\ \n\ \n\ \n\ // PoissonInputs targetting this group (if any)\n\ \n\ \n\ \n\ // Update state variables and the threshold condition\n\ \n\ double _v = $(v) * exp(1.0f*(- DT)/$(tau));\n\ $(v) = _v;\n\ char _cond = $(v) > 1;"); SET_THRESHOLD_CONDITION_CODE("_cond"); SET_RESET_CODE("$(v) = 0;"); SET_SUPPORT_CODE("\n\ template < typename T1, typename T2 > struct _higher_type;\n\ template < > struct _higher_type { typedef int type; };\n\ template < > struct _higher_type { typedef long type; };\n\ template < > struct _higher_type { typedef float type; };\n\ template < > struct _higher_type { typedef double type; };\n\ template < > struct _higher_type { typedef long type; };\n\ template < > struct _higher_type { typedef long type; };\n\ template < > struct _higher_type { typedef float type; };\n\ template < > struct _higher_type { typedef double type; };\n\ template < > struct _higher_type { typedef float type; };\n\ template < > struct _higher_type { typedef float type; };\n\ template < > struct _higher_type { typedef float type; };\n\ template < > struct _higher_type { typedef double type; };\n\ template < > struct _higher_type { typedef double type; };\n\ template < > struct _higher_type { typedef double type; };\n\ template < > struct _higher_type { typedef double type; };\n\ template < > struct _higher_type { typedef double type; };\n\ template < typename T1, typename T2 >\n\ #ifdef CPU_ONLY\n\ static inline typename _higher_type::type\n\ #else\n\ __host__ __device__ static inline typename _higher_type::type \n\ #endif\n\ _brian_mod(T1 x, T2 y)\n\ {{\n\ return x-y*floor(1.0*x/y);\n\ }}\n\ template < typename T1, typename T2 >\n\ #ifdef CPU_ONLY\n\ static inline typename _higher_type::type\n\ #else\n\ __host__ __device__ static inline typename _higher_type::type\n\ #endif\n\ _brian_floordiv(T1 x, T2 y)\n\ {{\n\ return floor(1.0*x/y);\n\ }}\n\ #ifdef _MSC_VER\n\ #define _brian_pow(x, y) (pow((double)(x), (y)))\n\ #else\n\ #define _brian_pow(x, y) (pow((x), (y)))\n\ #endif\n\ \n\ \n\ \n\ "); SET_PARAM_NAMES({ "tau" }); SET_VARS({ {"i", "int32_t"}, {"v", "double"} }); SET_EXTRA_GLOBAL_PARAMS({ }); }; IMPLEMENT_MODEL(neurongroupNEURON); // // define the synapse model classes // parameter values // neurons neurongroupNEURON::ParamValues neurongroup_p ( 0.01); // synapses // initial variables (neurons) neurongroupNEURON::VarValues neurongroup_ini ( uninitialisedVar(), uninitialisedVar()); // initial variables (synapses) // one additional initial variable for hidden_weightmatrix void modelDefinition(NNmodel &model) { initGeNN(); GENN_PREFERENCES::autoRefractory = 0; // Compiler optimization flags GENN_PREFERENCES::userCxxFlagsWIN = "/Ox /w /MP"; GENN_PREFERENCES::userCxxFlagsGNU = "-w -O3 -ffast-math -fno-finite-math-only -march=native"; GENN_PREFERENCES::userNvccFlags = "-O3"; // GENN_PREFERENCES set in brian2genn GENN_PREFERENCES::autoChooseDevice = 1; GENN_PREFERENCES::defaultDevice = 0; GENN_PREFERENCES::optimiseBlockSize = 1; GENN_PREFERENCES::preSynapseResetBlockSize = 32; GENN_PREFERENCES::neuronBlockSize = 32; GENN_PREFERENCES::synapseBlockSize = 32; GENN_PREFERENCES::learningBlockSize = 32; GENN_PREFERENCES::synapseDynamicsBlockSize = 32; GENN_PREFERENCES::initBlockSize = 32; GENN_PREFERENCES::initSparseBlockSize = 32; model.setDT(0.0001); model.setName("magicnetwork_model"); model.setPrecision(GENN_DOUBLE); model.addNeuronPopulation("neurongroup", 1000, neurongroup_p, neurongroup_ini); unsigned int delaySteps; model.finalize(); } 2019-11-30 15:53:10,370 DIAGNOSTIC brian2.devices.genn: Writing file main.*: h_file: //-------------------------------------------------------------------------- /*! \file main.h \brief Header file containing global variables and macros used in running the model. */ //-------------------------------------------------------------------------- using namespace std; #include #include "hr_time.h" #include "utils.h" // for CHECK_CUDA_ERRORS #include "stringUtils.h" #ifndef CPU_ONLY #include #else #define __host__ #define __device__ #endif #ifndef RAND #define RAND(Y,X) Y = Y * 1103515245 +12345;X= (unsigned int)(Y >> 16) & 32767 #endif // we will hard-code some stuff ... because at the end of the day that is // what we will do for the CUDA version #define DBG_SIZE 10000 // and some global variables CStopWatch timer; //---------------------------------------------------------------------- // other stuff: cpp_file: //-------------------------------------------------------------------------- /*! \file main.cu \brief Main entry point for the running a model simulation. */ //-------------------------------------------------------------------------- #include "main.h" #include "magicnetwork_model.cpp" #include "magicnetwork_model_CODE/definitions.h" #include "code_objects/spikemonitor_codeobject.h" #include "network.h" #include "objects.h" #include "b2glib/copy_static_arrays.h" #include "b2glib/convert_synapses.h" #include "code_objects/spikemonitor_codeobject.h" #include "engine.cpp" //-------------------------------------------------------------------------- /*! \brief This function is the entry point for running the simulation of the MBody1 model network. */ //-------------------------------------------------------------------------- int which; int main(int argc, char *argv[]) { if (argc != 4) { fprintf(stderr, "usage: main