How nest/nest-simulator works
Main Components
• Simulation Kernel: Represent the core engine that defines network dynamics and event handling. This includes the “nestkernel” directory (which houses submodules like connection handling, event management, MPI manager, device management, and recording backends) and the “nest” directory (further encapsulating startup routines and main simulation logic).
• Model and Neural Component Libraries: Group together directories such as “models”, “lib”, and “libnestutil” that provide a large collection of neurons, synapses, and other reproducible models.
• Scripting and Interface Layer: Highlight “sli” – the interpreter language that underpins script-based simulations – and “pynest” which contains Python bindings and example scripts. This layer translates user scripts (in Python or SLI) into simulation commands.
• User Interface & Examples: Include modules from “examples”, “doc”, and “pynest/examples” which show how users interact with the simulator.
• Build, Test, and Documentation Infrastructure: Capture directories such as “cmake”, “build_support”, “testsuite”, “thirdparty”, and “doc” that manage the build processes, testing routines, continuous integration (as seen in CI workflows), and documentation generation.
Relationships and Interactions
• The User Interface Layer (via Python interface in “pynest” or command-line/SLI commands) submits simulation configurations.
• Requests flow from these interfaces into the Simulation Kernel that schedules events, manages the network’s state, and uses MPI for parallel simulation on clusters.
• The Models Library feeds into the simulation kernel by supplying the neuron and synapse models.
• Communication flows both upwards (results and recordings sent to the UI, possibly through recording backends and visualization modules) and downwards (simulation parameters and network definitions provided by the UI).
• The build and test systems continuously ensure code quality and help integrate thirdparty libraries (such as Random123) ensuring the kernel’s performance and reproducibility.
Architectural Patterns and Design Principles
• Modular separation: The clear separation between the simulation engine, model libraries, and user interface reflects a layered architecture.
• Extensibility: Not only can the core be extended via custom modules (see “modelsets” and “libnestutil”), but the SLI interpreter and Python API enable straightforward integration with external tools.
• Scalability and parallelism: With MPI subcomponents (visible in “nest-server-mpi”, “testsuite/mpitests”, etc.) and careful design of the simulation kernel, NEST is scalable from laptops to supercomputers.