-
Notifications
You must be signed in to change notification settings - Fork 371
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
[DESIGN] Refactoring the extension module system #1717
Comments
👍 I think that reducing the SLI dependencies and unifying the architecture is very good. |
👍 yes, the dependencies are currently the wrong way around, which -as you mention- leads to unintuitive difficulties again and again. Thanks for taking a look at this and tidying up the long grown thicket. |
@jougs Thank you for describing this issue in detail and proposing a clean solution. I think converting, e.g., Concerning names, how about |
@heplesser: These are very good points. I like the name This would open the future to a highly customized NEST kernel that would just have exactly the components you need for a given simulation, or load the required components at run-time. |
This is a very interesting idea. In common current models, you probably have 1-2 neuron, 1-2 synapse and 2-5 device models, so in all 5-10 different entities that would require importing. In more complex models the number may be greater. I wonder a little about the overhead of importing, say 20-50 shared libraries in a very large distributed simulation of a complex brain model. And how would the user tell NEST to load the neuron model you need. If a model could only be used after the user ran an "install" command for the model, this would make interactive work cumbersome. |
I guess the answer would be that the user does not tell NEST to load the component at all, but it would be inferred from the function calls themselves. That is if NEST encounters a call to I don't think loading 50 something libraries is a problem, but if it turns out to be one, the required (or desired, in case of an interactive working scenario) components could always be statically linked. |
Issue automatically marked stale! |
The SLI Interpreter encapsulates a certain portion of its extended functionality in modules, which consist of some C++ code, implementing new commands, and (optionally) some bundled
.sli
file(s) for type checking and handling function overloading. All such modules derive fromSLIModule
and are added to the interpreter at compile-time by callingSLIInterpreter::addmodule()
.At some point in time, the
DynamicLoaderModule
was introduced, which let users load modules dynamically at run-time. The main use case for dynamically loaded modules is adding new neuron and synapse models, connection builders, or recording and (soon, see #1456) stimulation backends to NEST. TheDynamicLoaderModule
as well as the extension modules themselves are derived fromSLIModule
and thus are, at least technically, a part of SLI rather than of NEST.As SLI's modules were originally not meant to be loaded dynamically, but rather for encapsulation and to provide new commands to the SLI Interpreter, the API they (and by extension also the
DynamicLoaderModule
) rely on are lacking some functionality like the possibility to reset a module and read/pass parameters from/to them.NEST's mechanism for encapsulation are managers. A manager is responsible for a certain aspect of the simulation kernel (e.g. Models, MPI, Threading, RNGs, ...). In a sense, managers serve a similar purpose for NEST (encapsulation) as the modules originally did for SLI, however the implementations are somewhat orthogonal and the managers provide a much more complete API when it comes to dynamic parameter changes at run-time.
A closer look at the existing modules reveals the following situation:
modelsmodule
providing the standard neuron, device and synapse models to NEST) just use the module mechanism for encapsulation, while they are actually not interacting with the SLI Interpreter, but rather only with NEST.This basically means that we have two distinct classes of modules:
The current use of modules derived from
SLIModule
to extend both SLI and NEST statically (i.e. at compile-time) and dynamically (i.e. at run-time) constitutes a breach of abstraction and a stronger than necessary dependency of the NEST simulation kernel on the SLI Interpreter. This leads to a number of downsides:In order to address these issues, I propose a refactoring of the module mechanisms for NEST and SLI along the following list of concrete action items:
PreciseModule
into theModelsModule
(done in Merge precisemodule into modelsmodule #1705)ModelsModule
and register built-in models from theKernelManager
instead (prototype in Refactor ModelsModule to not be a SLIModule anymore #1853; then concluded that this should rather be done during the second phase)conngen
module to become aConnBuilder
and auxiliary SLI commands inNestModule
(done in Refactor conngen module to be a ConnBuilder #1830)TopologyModule
into the NEST kernel proper (done in Dissolve Topology module and move files to nestkernel/spatial #1748).DynamicLoaderModule
to anExtensionManager
for NESTNESTExtension
from which future extension modules (also from NESTML) can be derivedModelsModule
to become a first proof-of-conceptNESTExtension
Along the way, this might lead to a more complete C++ API in order to provide hooks for the new NEST extension modules.
The text was updated successfully, but these errors were encountered: