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

Moved check_synapse_params to specific synapse classes #739

Merged
merged 6 commits into from Jun 6, 2017

Conversation

Projects
None yet
4 participants
@stinebuu
Contributor

stinebuu commented May 31, 2017

This PR fixes #737 .

It takes each test in ConnBuilder::check_synapse_params() and moves it to a check_synapse_params() function in the respective synapse class. To make sure we don't have to add it to all the synapse classes, the GenericConnectionModel handles the allocation.

A regressiontest is also added, which make sure all tests fail if we send in the specific parameters in the syn_spec dictionary.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser May 31, 2017

Contributor

@stinebuu All subtest in issue-737.sli that use threading should go into a separate file and be skipped if threading is not available.

Contributor

heplesser commented May 31, 2017

@stinebuu All subtest in issue-737.sli that use threading should go into a separate file and be skipped if threading is not available.

@heplesser heplesser self-requested a review Jun 1, 2017

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Jun 1, 2017

Contributor

@kappeld Could you review this pull request? Since it adds the method check_synapse_params() to classes ConnectorModel and Connection, it may have an effect on your non-generic connector model. I particular, I think your connector model will have to implement the method.

Contributor

heplesser commented Jun 1, 2017

@kappeld Could you review this pull request? Since it adds the method check_synapse_params() to classes ConnectorModel and Connection, it may have an effect on your non-generic connector model. I particular, I think your connector model will have to implement the method.

@heplesser

Looks pretty good, I have just som comments that mainly concern documentation.

Show outdated Hide outdated models/cont_delay_connection.h
Show outdated Hide outdated models/quantal_stp_connection.h
Show outdated Hide outdated models/static_connection_hom_w.h
Show outdated Hide outdated models/stdp_dopa_connection.h
Show outdated Hide outdated nestkernel/conn_builder.cpp
Show outdated Hide outdated nestkernel/connection.h
Show outdated Hide outdated nestkernel/connector_model.h
Show outdated Hide outdated testsuite/regressiontests/issue-737-threads.sli
@kappeld

This comment has been minimized.

Show comment
Hide comment
@kappeld

kappeld Jun 1, 2017

Contributor

At a first glance the changes look good to me, but they will effect our custom connector model as @heplesser suggested. I will try this out and review the changes more carefully as soon as possible.

Contributor

kappeld commented Jun 1, 2017

At a first glance the changes look good to me, but they will effect our custom connector model as @heplesser suggested. I will try this out and review the changes more carefully as soon as possible.

@heplesser

Looks good, just a few more details on comments.

Show outdated Hide outdated models/cont_delay_connection.h
Show outdated Hide outdated models/quantal_stp_connection.h
Show outdated Hide outdated models/stdp_dopa_connection.h

@heplesser heplesser requested a review from jakobj Jun 2, 2017

@jakobj

jakobj approved these changes Jun 2, 2017 edited

Great work! Much clearer now. I just have this one comment below, otherwise I am happy.

* @note Classes requiring checks need to override the function with their own
* implementation, as this base class implementation does not do anything.
*/
void check_synapse_params( const DictionaryDatum& d ) const;

This comment has been minimized.

@jakobj

jakobj Jun 2, 2017

Contributor

If subclasses should override this function, shouldn't it be declared virtual?

@jakobj

jakobj Jun 2, 2017

Contributor

If subclasses should override this function, shouldn't it be declared virtual?

This comment has been minimized.

@stinebuu

stinebuu Jun 2, 2017

Contributor

@jakobj As far as I understand, the connection class is not supposed to have any virtual functions, because we then store pointers to the subclasses so we can use the correct overridden function. By making this into an empty function, we avoid this memory allocation.

@heplesser does this sound about right?

@stinebuu

stinebuu Jun 2, 2017

Contributor

@jakobj As far as I understand, the connection class is not supposed to have any virtual functions, because we then store pointers to the subclasses so we can use the correct overridden function. By making this into an empty function, we avoid this memory allocation.

@heplesser does this sound about right?

This comment has been minimized.

@heplesser

heplesser Jun 2, 2017

Contributor

Yes, the technical term is vtable: For the 4G kernel we worked hard to avoid virtual functions in Connection objects so that these objects do not contain a vtable-pointer, which would cost 8B per synapse; see Kunkel et al (2014) for details.

@heplesser

heplesser Jun 2, 2017

Contributor

Yes, the technical term is vtable: For the 4G kernel we worked hard to avoid virtual functions in Connection objects so that these objects do not contain a vtable-pointer, which would cost 8B per synapse; see Kunkel et al (2014) for details.

This comment has been minimized.

@jakobj

jakobj Jun 2, 2017

Contributor

Ah alright, should've known that. ;) thanks for reminding me.

@jakobj

jakobj Jun 2, 2017

Contributor

Ah alright, should've known that. ;) thanks for reminding me.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Jun 2, 2017

Contributor

Before merging, wait for feedback from @kappeld concerning the effect on module implementing its own ConnectorModel.

Contributor

heplesser commented Jun 2, 2017

Before merging, wait for feedback from @kappeld concerning the effect on module implementing its own ConnectorModel.

@kappeld

kappeld approved these changes Jun 6, 2017

I have checked out these changes and ran our tests. The modified API works fine with our custom nest module.

@kappeld

This comment has been minimized.

Show comment
Hide comment
@kappeld

kappeld Jun 6, 2017

Contributor

On a related note: Since the API of NEST has changed now quite a bit since the 2.12.0 release (with this and other changes), @heplesser are you planning to issue a 2.12.1 release soon? We would like to keep the version numbers of our custom module in sync with NEST's version number. Since the changes made to NEST also require a slightly updated version of our module to be compatible, making a new minor release might be more transparent for the users.

Contributor

kappeld commented Jun 6, 2017

On a related note: Since the API of NEST has changed now quite a bit since the 2.12.0 release (with this and other changes), @heplesser are you planning to issue a 2.12.1 release soon? We would like to keep the version numbers of our custom module in sync with NEST's version number. Since the changes made to NEST also require a slightly updated version of our module to be compatible, making a new minor release might be more transparent for the users.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Jun 6, 2017

Contributor

@kappeld Thanks for checking! Yes, we are considering a 2.12.1 release since there have been a number of bug fixes (and a few more under review).

Contributor

heplesser commented Jun 6, 2017

@kappeld Thanks for checking! Yes, we are considering a 2.12.1 release since there have been a number of bug fixes (and a few more under review).

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Jun 6, 2017

Contributor

Release Notes: Refactored check_synapse_param() to better object-oriented design. Connection subclasses can now define their own checks.

Contributor

heplesser commented Jun 6, 2017

Release Notes: Refactored check_synapse_param() to better object-oriented design. Connection subclasses can now define their own checks.

@heplesser heplesser merged commit 277bb37 into nest:master Jun 6, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kappeld kappeld referenced this pull request Jun 6, 2017

Closed

Make SPORE citable #14

@stinebuu stinebuu deleted the stinebuu:issue737 branch Jun 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment