Skip to content
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

Undeclared Identifier Error for Multiple Runs #129

Open
ademirtas04 opened this issue Aug 15, 2021 · 6 comments
Open

Undeclared Identifier Error for Multiple Runs #129

ademirtas04 opened this issue Aug 15, 2021 · 6 comments

Comments

@ademirtas04
Copy link

Hey there! I was running my first code on Brian2Genn, and I was trying to run the code multiple times on the same Jupyter Notebook File. It seems as though the code is looking for objects in the previous run, as it sometimes gives no error and plots a graph and other times gives the undeclared identifier error. I was wondering if I was using the device.activate() and device.reinit() methods properly, or if there is something else that I am missing.

from brian2 import *
import brian2genn

%matplotlib inline

set_device('genn')

device.reinit()
device.activate()

start_scope()

G = NeuronGroup(1, 'v : 1', threshold='v>0.6', reset='v=0', method='exact')
G.v = '0.6'
SM = StateMonitor(G, 'v', record=True)
print("Completed without Errors")

run(100*ms)
print("Ran without Errors")

plot(SM.t/ms, SM.v[0])

device.reinit()
device.activate()

ERROR PROVIDED:
neurongroup_group_variable_set_conditional_codeobject.cpp
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(8,1): warning C4005: 'INFINITY': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(88): message : see previous definition of 'INFINITY' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(9,1): warning C4005: 'NAN': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(92): message : see previous definition of 'NAN' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
statemonitor_codeobject.cpp
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(8,1): warning C4005: 'INFINITY': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(88): message : see previous definition of 'INFINITY' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\brianlib\common_math.h(9,1): warning C4005: 'NAN': macro redefinition [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(92): message : see previous definition of 'NAN' [C:\Users\ademi\GeNNworkspace\project.vcxproj]
main.cpp
C:\Users\ademi\GeNNworkspace\engine.cpp(45,19): error C2065: 'vneurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\engine.cpp(51,7): error C3861: 'pullneurongroupStateFromDevice': identifier not found [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(73,47): error C2065: 'ineurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(74,47): error C2065: 'vneurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(106,15): error C2065: 'ineurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]
C:\Users\ademi\GeNNworkspace\main.cpp(107,15): error C2065: 'vneurongroup': undeclared identifier [C:\Users\ademi\GeNNworkspace\project.vcxproj]

@tnowotny
Copy link
Contributor

tnowotny commented Aug 16, 2021

Hum ... I tried to reproduce the problem but it doesn't occur for me. Any ideas @mstimberg ?
Besides, you would only need one call to device.reinit() at the end of this code snippet and no calls to device.activate as the set_device function on top takes care of activation.

@ademirtas04
Copy link
Author

I called device.reinit() only once and did not call device.activate() in my new code, and it continues to provide the same error. Could the difference in results be due to different GPUs being used?

@tnowotny
Copy link
Contributor

It is unlikely that a different GPU would make a difference here. However, from your posted output I can see you are working on Windows (whereas I am on a Mac).
Could you locate and upload the content of
C:\Users\ademi\GeNNworkspace\magicnetwork_model_CODE\
after one of the unsuccessful runs?
I will be away next week, and @mstimberg seems busy - so I'll pull in @neworderofjamie for any thoughts on this?

@neworderofjamie
Copy link
Collaborator

Hi @ademirtas04, @tnowotny is off this week but I'm back (that's August for you...) - are you still have problems with this?

@ademirtas04
Copy link
Author

Hi @neworderofjamie! Yep. I'm still having problems with it.

@neworderofjamie
Copy link
Collaborator

Good to know - in that case, could you upload the contents of the folder @tnowotny said?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants