# sstsimulator/sst-core architecture

> Architecture diagram of the GitHub repository sstsimulator/sst-core, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sstsimulator/sst-core
- Repository: https://github.com/sstsimulator/sst-core

## Overview

Key Components to Include:

##### Core Simulation Engine
- Main simulation controller (src/sst/core/simulation.cc)
- Time management system (timeVortex, timeLord)
- Event management system

##### Component Management Layer
- Component factory system
- Base component infrastructure
- Subcomponent management
- Link management system

##### Model Interface Layer
- Python model interface
- JSON model interface
- XML configuration support
- How these connect to the core simulation engine

##### Parallel Execution Framework
- MPI communication layer
- Synchronization management
- Thread management for parallel execution
- Both rank and thread synchronization mechanisms

##### Statistics and Monitoring
- Statistics collection framework
- Output management
- Performance tracking
- Profile tools

##### Layer organization (top to bottom)
- [External Interfaces (Python, JSON, XML)]
- ↓
- [Model Interface Layer]
- ↓
- [Core Simulation Engine] ←→ [Parallel Execution Framework]
- ↓
- [Component Management]
- ↓
- [Statistics & Monitoring]

##### Important relationships
- Event flow between components
- Synchronization paths
- Configuration data flow
- Statistics collection paths

##### Specific subsystems
- TimeVortex implementation
- Link management
- Factory system
- Serialization framework
- Statistics backends
- MPI communication paths

Key Guidelines:

##### Maintain clear separation between
- Core simulation logic
- Model interfaces
- Parallel execution management
- Statistics and monitoring

##### Important subsystems
- RNG management
- Memory pools
- Shared objects
- Profile tools

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef core fill:#b3d1ff,stroke:#333
    classDef interface fill:#90EE90,stroke:#333
    classDef parallel fill:#FFB366,stroke:#333
    classDef stats fill:#DDA0DD,stroke:#333
    classDef storage fill:#E6E6E6,stroke:#333
    
    %% External Interfaces Layer
    subgraph Interfaces
        PY["Python Interface"]
        JSON["JSON Interface"]
        XML["XML Config"]
    end

    %% Model Interface Layer
    subgraph ModelInterface
        MI["Model Interface Controller"]
        CFG["Configuration Manager"]
    end

    %% Core Simulation Engine
    subgraph CoreEngine
        SIM["Simulation Controller"]:::core
        TV["TimeVortex"]:::core
        TL["TimeLord"]:::core
        EM["Event Manager"]:::core
    end

    %% Component Management
    subgraph ComponentMgmt
        CF["Component Factory"]:::core
        BC["Base Component"]:::core
        SC["Subcomponent Manager"]:::core
        LM["Link Manager"]:::core
    end

    %% Parallel Execution Framework
    subgraph ParallelExec
        SYNC["Sync Manager"]:::parallel
        TM["Thread Manager"]:::parallel
        MPI["MPI Communication"]:::parallel
    end

    %% Statistics and Monitoring
    subgraph StatsMon
        SF["Statistics Framework"]:::stats
        OM["Output Manager"]:::stats
        PT["Profile Tools"]:::stats
    end

    %% Relationships
    PY --> MI
    JSON --> MI
    XML --> MI
    MI --> CFG
    CFG --> SIM
    SIM --> TV
    SIM --> TL
    SIM --> EM
    SIM <--> SYNC
    SYNC --> TM
    SYNC --> MPI
    SIM --> CF
    CF --> BC
    BC --> SC
    BC --> LM
    SIM --> SF
    SF --> OM
    SF --> PT

    %% Click events
    click PY "https://github.com/sstsimulator/sst-core/tree/master/src/sst/core/model/python/"
    click JSON "https://github.com/sstsimulator/sst-core/tree/master/src/sst/core/model/json/"
    click XML "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/cfgoutput/xmlConfigOutput.cc"
    click SIM "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/simulation.cc"
    click TV "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/timeVortex.cc"
    click TL "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/timeLord.cc"
    click EM "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/event.cc"
    click CF "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/factory.cc"
    click BC "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/baseComponent.cc"
    click SC "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/subcomponent.cc"
    click LM "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/link.cc"
    click SYNC "https://github.com/sstsimulator/sst-core/tree/master/src/sst/core/sync/"
    click TM "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/sync/threadSyncDirectSkip.cc"
    click MPI "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/sync/rankSyncParallelSkip.cc"
    click SF "https://github.com/sstsimulator/sst-core/tree/master/src/sst/core/statapi/"
    click OM "https://github.com/sstsimulator/sst-core/blob/master/src/sst/core/statapi/statoutput.cc"
    click PT "https://github.com/sstsimulator/sst-core/tree/master/src/sst/core/profile/"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Interface Components"]:::interface
        L3["Parallel Components"]:::parallel
        L4["Statistics Components"]:::stats
        L5["Storage Components"]:::storage
    end
```
