Repository navigation
Conversation
NEST 3.11 adds a delay-type template parameter to nest::Connection and a syn_id argument to check_connection(). NEST has no numeric version macros, so nest_compat.h detects 3.11+ by the presence of delay_types.h, which first appears in that release. The with-python CMake option was removed in NEST 3.11, which now rejects unknown options; it defaulted to ON in earlier versions. Verified that the extensions build and test_nest.py passes against both NEST 3.10.0 and 3.11.0rc1.
Since NEST 3.11rc2 (nest/nest-simulator#3533), connections may be reordered when simulating, and a SynapseCollection obtained before Simulate() then returns the source of one connection with the target and parameters of another. Projection.get() therefore returned wrong weights after a run (test_scenario3 failed with NaN p-value). The single global stale flag also meant that only the first projection to refresh its cache saw it; a generation counter fixes this too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NEST 3.11 changes the C++ synapse API:
nest::Connectiontakes a second template parameter (the delay type, e.g.nest::TotalDelay), andcheck_connection()takes an additionalsyn_idargument. As a result, thepynn_extensionsmodule (simple_stochastic_synapse,stochastic_stp_synapse) does not compile against NEST 3.11.Here, we add a small header,
nest_compat.h, which detects NEST ≥ 3.11 and provides apynn::NestConnection<T>alias for the appropriate base class.check_connection()has a version for each API. NEST provides only a version string, not numeric version macros, so detection uses__has_include("delay_types.h"), a header introduced in 3.11. The extensions still build against earlier NEST versions.In addition, since nest/nest-simulator#3533 (in 3.11rc2), NEST may reorder connections when simulating, so a
SynapseCollectionobtained beforeSimulate()returns mismatched data afterwards. Currently,Projectioncaches the result ofGetConnections()and only refreshes it after new connections are created, so attributes read after a run can be attributed to the wrong connections. Here, we refresh the cache after every run, using a generation counter in place of the single global "stale" flag, which also ensures that every projection, not just the first one, refreshes its cache.We also remove
-Dwith-python=ONfrom theMakefile. The option no longer exists in NEST 3.11, which now treats unknown CMake options as errors. It defaulted to ON in earlier versions.Tested with NEST 3.11.0rc2, NEURON 9.0.2, Brian2 2.11.0 and Arbor 0.12.2 on macOS (arm64): 958 passed, 2 failed. The two failures are in
test/system/test_nest_nestml.py. Synapse code generated by NESTML 9.0.1 has the same incompatibility with the NEST 3.11ConnectionAPI, so this needs fixing in NESTML. With NEST 3.10.0, the unit tests and the NEST system and scenario tests pass.To build NEST 3.11.0rc2 with the Makefile without Boost installed, pass
-Dwith-boost=OFFviaEXTRA_CMAKE_ARGS(Boost is now enabled by default).