# Description of problem

I am trying to reproduce the method of this article by Masquelier and Deco in Brian2: Network Bursting Dynamics in Excitatory Cortical Neuron Cultures Results from the Combination of Different Adaptive Mechanism. In short; it simulates a network of 800 fully connected excitatory LIF neurons with adaptation and STP. Reproducing it worked out and I am getting almost the same results. However, one simulation of 60 second takes about 3 to 4 hours to run. Therefore I am trying to speed it up by running it on the powerful GPU I have, through Brian2GeNN. First run I got the error: ‘‘brian2genn only supports a single summed variable per Synapses group.’’ So I rewrote to only sum s_nmda, instead of also s_ampa. Now I get the error: ‘‘brian2genn only supports a either a single synaptic output variable or a single summed variable per Synapses group.’’ and when I look in the Brian2GeNN documentation it says: ‘‘Summed variables are currently not supported in GeNN ‘’. So at this point it is unclear to me if no summed variables at all are allowed, or just not more than one. The manual states as a solution: ‘’ However, a simple form of summed variable is supported and intrinsic to GeNN. This is the action of ‘pre’ code in a Synapses definition onto a pre-synaptic variable. The allowed interaction is summing onto one pre-synaptic variable from each Synapses group.’’ But I am really unsure what this means and how to do this, an example would be super helpful.

The documentation of Brian2Genn also states ‘’ GeNN does not have support for multiple synaptic pathways as Brian 2 does, you can therefore only use a single pre and post pathway with Brian2GeNN’’. This is also slightly vague to me. Does this mean I cannot have more than one variable update per synapse? Or just not explicit pathways with names. And if it is not possible to have both nmda gating variable change and ampa gating variable change in one synapse with Brian2GeNN, how can I work around this? Should I make multiple Synapses groups?

# Minimal code to reproduce problem

```
from scipy.io import *
from scipy.sparse import *
from scipy import *
import os
from numpy import *
from numpy import random
from brian2 import *
import brian2genn
set_device('genn')
Ne = 800
#receptor parameters
delta = 0.08
g_ampa = ((104.0*(1+10*delta))/1000)*nS
g_nmda = ((327*(1-delta))/1000)*nS
E_ampa = 0*mV
E_nmda = 0*mV
tau_ampa = 2*ms
taus_nmda = 100*ms
taux_nmda = 2*ms
alpha_nmda = 0.5*kHz
#Adaptation parameters
E_AHP = -80*mV
g_AHP = 10*nS
alpha_Ca = 0.0145
tau_Ca = 4000*ms
#neuron model parameters
sigma = 6.5*mV
Cm = 0.5*nF
gl = 25*nS
El = -70*mV
Vthr = -50*mV
Vreset = -55*mV
refr = 2. * ms
#STP parameters
tau_f = 1600*ms
tau_d = 800*ms
U = 0.025
#Define simple model with reset
eqs = Equations('''dV/dt = sigma*xi*(2*gl/Cm)**.5 + 1/Cm * (-gl*(V-El)-I_syn+I_I_AHP) :volt
I : amp
I_syn = I_ampa + I_nmda : amp
I_ampa = g_ampa*(V-E_ampa)*s_ampa_tot : amp
I_nmda = g_nmda*(V-E_nmda)*s_nmda_tot/(1+exp(-0.062*V/mV)/3.57) : amp
s_nmda_tot :1
s_ampa_tot : 1
I_AHP = -g_AHP*Ca*(V-E_AHP) : amp
dCa/dt = - Ca / tau_Ca : 1 ''')
P = NeuronGroup(Ne, eqs, threshold='V>Vthr', reset='''V=Vreset
Ca += alpha_Ca''', refractory=refr, order=1, method='euler')
P.V = -70*mV
#Define synapse models
eqs_synapsmodel = '''
s_nmda_tot_post = w *u_f * x_d * s_nmda :1 (summed)
ds_nmda/dt = -s_nmda/(taus_nmda)+alpha_nmda*x*(1-s_nmda) : 1 (clock-driven)
s_ampa_tot_post = w *u_f * x_d * s_ampa :1 (summed)
ds_ampa/dt = -s_ampa/tau_ampa :1 (clock-driven)
dx/dt = -x/(taux_nmda) :1 (clock-driven)
dx_d/dt = (1-x_d)/tau_d :1 (event-driven)
du_f/dt = (U-u_f)/tau_f :1 (event-driven)
w : 1
'''
eqs_onpre = '''
x += 1
u_f += U*(1-u_f)
x_d *= (1-u_f)
s_ampa += 1
'''
Conn = Synapses(P, P, model=eqs_synapsmodel, on_pre=eqs_onpre, delay=3*ms, method='euler')
Conn.connect()
Conn.w[:] = 9.25
Conn.u_f[:] = U
Conn.x_d[:] = 1
run(3*second, report='text')
```

# What you have aready tried

I’ve tried changing the neuron and synapse equations to:

```
eqs = Equations('''dV/dt = sigma*xi*(2*gl/Cm)**.5 + 1/Cm * (-gl*(V-El)-I_syn+I+I_AHP) :volt
I : amp
I_syn = I_ampa + I_nmda : amp
I_ampa = g_ampa*(V-E_ampa)*s_ampa : amp
I_nmda = g_nmda*(V-E_nmda)*s_nmda_tot/(1+exp(-0.062*V/mV)/3.57) : amp
s_nmda_tot :1
ds_ampa/dt = -s_ampa/tau_ampa :1
I_AHP = -g_AHP*Ca*(V-E_AHP) : amp
dCa/dt = - Ca / tau_Ca : 1 ''')
eqs_synapsmodel = '''
s_nmda_tot_post = w *u_f * x_d * s_nmda :1 (summed)
ds_nmda/dt = -s_nmda/(taus_nmda)+alpha_nmda*x*(1-s_nmda) : 1 (clock-driven)
dx/dt = -x/(taux_nmda) :1 (clock-driven)
dx_d/dt = (1-x_d)/tau_d :1 (event-driven)
du_f/dt = (U-u_f)/tau_f :1 (event-driven)
w : 1
'''
eqs_onpre = '''
x += 1
u_f += U*(1-u_f)
x_d *= (1-u_f)
s_ampa += w *u_f * x_d
'''
```

# Expected output (if relevant)

# Actual output (if relevant)

# Full traceback of error (if relevant)

Traceback only goes back to ‘’ exec(code, self.locals)’’. The error occurred after ‘‘building genn executable …’’.

I hope the questions are somewhat clear. Thanks in advance!