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

Fix compilation error when synapse model uses random_normal function #805

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pnbabu
Copy link
Contributor

@pnbabu pnbabu commented Aug 24, 2022

Fixes #804

Unlike the neuron class, the synapse class in the generated code does not have an implementation of the get_thread() function that is used in nest::normal_distribution. This PR adds a private implementation of the function and returns the thread id from the NEST kernel.

@pnbabu pnbabu marked this pull request as ready for review August 25, 2022 15:12
@pnbabu
Copy link
Contributor Author

pnbabu commented Aug 25, 2022

Note: #806 needs to be fixed before this is merged.

@pnbabu pnbabu requested a review from clinssen August 25, 2022 15:13
return tid;
}
{%- endif %}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just use kernel().vp_manager.get_thread_id() directly wherever this is needed? I'm not sure I like this additional indirection... Optimally, I think get_thread_id() should just be available as an API function in the nest namespace defined in nestkernel/nest.h in NEST Simulator proper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated code for the random_normal() function from NESTML is the same for both neurons and synapses. See here. The neuron already has an implementation of the get_thread() function in its base class whereas the synapse doesn't. Hence this PR adds a private implementation for the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should synapses instead use the thread t that is passed as a parameter to the send() method, rather than calling kernel().vp_manager.get_thread_id()? (cc @jougs)

@pnbabu
Copy link
Contributor Author

pnbabu commented Aug 23, 2023

This needs to be fixed from the NEST end. The corresponding issue in NEST: nest/nest-simulator#2902

@clinssen
Copy link
Contributor

@pnbabu: is this PR superseded by #1018?

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

Successfully merging this pull request may close these issues.

Compilation of NESTML synapse model fails when random_normal() function is used
3 participants