-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add infrastructure for generic input backends to feed devices #1456
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this great addition! I have quite a few suggestions, but there are a lot of similar ones, and all of them are minor.
Thank you dear @hakonsbm we will work on these corrections right away. |
Thank you @hakonsbm for all requests. @sdiazpier and me fix all of this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sdiazpier @lionelkusch Thanks for the changes! Just a few more and I'm happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During NESTio/Output, all recorders were refactored to be derived from RecordingDevice
instead of having one as a member. The base class RecordingDevice
is now deriving from DeviceNode
and Device
.
During the work on this PR, a new base class InputDevice
was introduced to handle the stimulus data coming from a backend instead of from parameter data members in the concrete stimulator class. I propose several changes:
-
A refactoring along the lines of the one described above would simplify the design. Namely, making
StimulatingDevice
a base class of the concrete stimulator. -
To further simplify the design, the functionality of the new base class
InputDevice
should be included into theStimulatingDevice
class. -
The base class for recording backends was first called
OutputBackend
. We decided to rename them toRecordingBackends
to make clear that they are not backends for general output operations from within NEST, but only handle the output generated by recorders. The same considerations apply to the naming of the currentInputBackend
base class, which IMO should be renamed toStimulatingBackend
-
The derivation of the
SpikeParameters_
struct from the classParameters_
, which is a nested member of theInputDevice
base class, looks unusual to me. I have not looked into this in detail, but think that a mechanism usingget_/set_status()
should be used instead and would result in a cleaner design. The same considerations apply to theState_
struct. -
Why is the InputBackendInternal needed at all if it does nothing? Couldn't an empty input_from field just be interpreted in this way?
-
The
InputBackend
base class is currently more or less a copy of theRecordingBackend
, which raises a number of questions:-
The documentation is still mostly describing the design and workings of the recording backend infrastructure with just the word "recording" replaced by "input".
-
I don't understand how some of the interface functions that were taken from the recording backend design are actually useful for the input side.
-
One example is
set_value_names()
. If I understand the code correctly, all assignments of incoming data to device member variables is solely handled byupdate_from_backend()
inside of the concrete stimulator and backends don't have to know about the data layout or field names at all. -
I don't quite see how all the hooks are useful for the input side. In my view an input backend receives data from somewhere once per cycle and has to hand that over to all enrolled devices without the need for a more fine grained flow control. If I'm wrong, possible use cases should be explained in the documentation of the corresponding interface functions in the base class for input backends.
-
-
-
In general, some things should be renamed from my point of view:
input_from
⟶stimulus_source
ordata_source
MPIFilePortsUnknown
⟶MPIPortsFileUnknown
- The name of the function
update_from_backend()
is misleading, as theupdate()
function of nodes in NEST is used to propagate their state once every time cycle. A better name would beset_data_from_input_backend()
or something similar.
cc @maedoc |
@lionelkusch, @sdiazpier: can you please give a short update of the status? Many thanks! |
This is just a friendly ping! |
Dear @jougs we are still working on details merging the stimulating device with the input device. However, the more simple things we have mostly addressed already:
As soon as we finalize the open points we will update the PR. |
Awesome! Many thanks for the update and all the work in the background :-) |
Co-authored-by: Jochen Martin Eppler <[email protected]>
Co-authored-by: Jochen Martin Eppler <[email protected]>
Co-authored-by: Jochen Martin Eppler <[email protected]>
Co-authored-by: Jochen Martin Eppler <[email protected]>
…t_step_hook function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your changes! Here are three more comments.
Pleas consider using the "batch commit" feature in the "Files Changed" pane in the future. That way you could bundle multiple suggestions into a single commit and also reduce the number of notification mails sent by GitHub. Thanks!
Dear @jougs about the diagrams, communication_Nest.pdf, Nest_IO.pdf and state_Nest.pdf, where would it be good to store them so we can reference from the developer documentation? |
@sdiazpier, many thanks. All my suggestions are addressed! Regarding the diagrams: @jessica-mitchell, what would be an appropriate location for such static content of the developer documentation? I tend to think that |
Dear @jougs and @jessica-mitchell, |
I would appreciate if the figures were added also in a vector format or any source format they were generated from. The rationale for this is that we might need to tweak the figures in the future. I suggest to add them to I would be OK with approving this without more extensive developer documentation, but would like to see at least some basic information about the idea on the user level stimulation guide. Also the links to the MPI backend documentation in the recording and stimulation guides are needed, so they can actually be found. After reviewing #1929, I think we also need a section on the availability of the Stimulating Backend infrastructure in the NEST 2->3 guide. @jessica-mitchell, can you please give a hint on where this should best go? |
@jougs I'd suggest if it's a user level document to highlight the new feature, it should go here:
Also the devdoc/static sounds fine to me too |
Add images for develloper documentation and add it in doxygen documentation. Add files from UMLET which generate the image. Modification of documentation of stimulus and recording with MPI backend for user documentation.
Hi @jougs, @sdiazpier : Can you take a short look to check if I am not missing something? |
Dear @lionelkusch thanks so much for adding the figures and documentation. Dear @jougs I think we are ready for your final checks. Hopefully everything is now covered. |
@lionelkusch, @sdiazpier: Many thanks! I have just sent a PR towards your branch, in which I mostly reworked the structure of the user level documentation. I think you don't have to look into it in detail, as I already discussed most changes with @jessica-mitchell and @terhorstd. Once that's merged, I'll merge this one. |
* Added epsilon to position checks Because of round-off errors when comparing node positions to lower left and upper right. * Removed unnecessary preprocessor directive * Added documentation on parameter comparators * Added test of round-off errors when connecting spatial populations * Added comments on epsilon values * Clarified a sentence * Fixed regex to correctly catch warnings * Updated return statements that are used in only rare cases * Added warnings from random123 library to known warnings * Fixed warning for implicitly declared operator=() * Fixed warning for unordered initialization of variables * Fixed warning for comparison of unsigned variable >= 0 * Fixed warnings from MUSIC models * Using a negative epsilon value for the other comparison as well * Apply suggestions from code review Co-authored-by: jessica-mitchell <[email protected]> * Apply suggestions from code review Co-authored-by: Hans Ekkehard Plesser <[email protected]> * Formatting * Updated return values in docstring * Add renamed 'time' to 'biological_time' kernel status variable * fix renamed 'time' to 'biological_time' kernel status variable * add colour highlighting to NEST 3.0 guide * fix rST syntax Co-authored-by: Håkon Bakke Mørk <[email protected]> * Rework stimulating device/backend documentation The purpose of this commit is to make the documentation of stimulating devices/backends more consistent with that of recording devices/backends. It also updates the corresponding guides. * Fix formatting * Fix formatting * Fix reordering warning Co-authored-by: Håkon Mørk <[email protected]> Co-authored-by: jessica-mitchell <[email protected]> Co-authored-by: Hans Ekkehard Plesser <[email protected]> Co-authored-by: clinssen <[email protected]> Co-authored-by: C.A.P. Linssen <[email protected]> Co-authored-by: Stine Brekke Vennemo <[email protected]>
Dear @jougs and everyone involved in the PR, I just merged your changes to our branch. Thanks so much for the revised documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also many thanks from my side for all the hard work!
This PR adds the infrastructure required for the input part of NESTio.
See #1283 for the RecordingBackend counterpart of the NESTio infrastructure.