Managers in NEST

At the heart of NEST are various managers, each responsible for specific aspects of the simulation process.

The ManagerInterface provides a common interface for all managers, defining standard methods and properties.

The KernelManager acts as the core, coordinating the other managers that specialize in different aspects of the simulation.

KernelManager initializes all managers in dependency order:

Main control flow

  1. Initialization: - The Kernel Manager initializes the simulation environment, allocating resources and setting up initial configurations. - The Simulation Manager sets up the simulation based on defined parameters.

  2. Node and Connection Setup: - The Node Manager creates and configures nodes. - The Connection Manager establishes connections between nodes.

  3. Model Application: - The Model Manager loads and applies models to nodes and connections. - The SP Manager applies synaptic plasticity rules as needed.

  4. Simulation Execution: - The Simulation Manager oversees the execution phase, with the Event Delivery Manager ensuring events are processed correctly. - The MPI Manager handles parallel processing tasks if the simulation is distributed.

  5. Data Handling: - The IO Manager reads configuration files and writes simulation results. - The Logging Manager captures diagnostic information for debugging.

  6. Cleanup: - The Simulation Manager ensures resources are cleaned up after the simulation completes.

Advanced Architectural Features

  • Policy-based template pattern for manager customization: - The policy-based template pattern is used to customize specific manager behaviors, allowing developers to extend functionality without modifying core logic.

  • Thread-local storage for performance-critical components: - Thread-local storage is employed for performance-critical components to minimize contention and improve parallel execution efficiency.

  • Double dispatch pattern for event handling: - The double dispatch pattern is used for event handling, enabling dynamic and type-safe event processing across different node and connection types.

  • MPI-agnostic interfaces through manager abstraction: - MPI-agnostic interfaces are provided through manager abstraction, allowing the simulation to run seamlessly with or without MPI, enhancing flexibility and portability.

  • Multiple synchronization strategies:

    • MPI_Barrier is used for global synchronization to ensure all processes reach a certain point before proceeding.

    • OpenMP locks are employed for shared memory parallelism to manage access to shared resources.

    • Atomic operations are used for spike counter updates to ensure thread-safe increments without locks.

    • RAII patterns are used for resource management to ensure proper acquisition and release of resources.