-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with multiple run()
calls
#86
Comments
Another bug with multiple runs and delays. When running this script from brian2 import *
import brian2cuda
def test(mode='cuda'):
set_device(mode+'_standalone', directory=None, build_on_run=False,
with_output=False)
inG = NeuronGroup(1, 'v : 1', threshold='True')
G = NeuronGroup(2, 'v : 1')
G.v[:] = 0
S = Synapses(inG, G, on_pre='v += 1')
S.connect()
S.delay[:] = array([0,1]) * defaultclock.dt
mon = StateMonitor(G, 'v', record=True)
run(2*defaultclock.dt)
run(2*defaultclock.dt)
device.build(direct_call=False, **device.build_options)
print mon.v[:]
if __name__ == '__main__':
test()
test(mode='cpp') I get as output for the
and for
This bug does only occur if we have different delays for both synapses. Looks like the last spike in EDIT |
while we have to fix the multiple runs bug before releasing, we can do this under the assumption that delay and dt do not change between runs we need to raise an error (with reference to the respective issue) if a user tries to change it anywys |
see also: brian-team/brian2genn#76 (last comment by @mstimberg ) |
This issue is being fixed in PR #300
|
There seem to be some issues when using multiple
run()
calls. First there is #85.Then we are adding
cudaProfileStart()
andcudaProfileStop()
around eachNetwork.run()
call. Not sure if we keep those for the final release anyways, but we should be aware of it.Then just from looking it seems like we have a memory leak when
synapses_initialise_queue.cu
is rerun betweenrun()
calls (e.g. when thedelay
value is changed). In that case, we just allocate new memory for all device variables created insynapses_initialise_queue.cu
and save their pointers to the global variables as before (without freeing the memory they pointed to before, after the first initialisation.) And we call theCudaSpikeQueue.prepare()
method for spikequeues, for which we already called that method, which create new queues (cudaVectors
) without deleting the old ones.Similar situations might happen when other variables are changed between
run()
calls. Therefore, some tests would be appropriate.The text was updated successfully, but these errors were encountered: