# llanskoyll/ehc-labs architecture

> Architecture diagram of the GitHub repository llanskoyll/ehc-labs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/llanskoyll/ehc-labs
- Repository: https://github.com/llanskoyll/ehc-labs

## Overview

##### Main Components
- Lab Modules: The repository is divided into several lab or experiment directories that each focus on a particular exercise (e.g., “1_mmult” for a matrix multiplication experiment, “2_aos_soa” for comparing memory layouts [Array of Structures vs. Structure of Arrays], “3_primary_nums” for prime number computations, various “4_vector_*” folders for vectorization experiments, “n_vector”, “n-body-example”, “sycl_example”, and the “LABS” directory with its subdirectories).
- Build System: Almost every lab includes a CMakeLists.txt – indicating that the build process and configuration system (CMake) is a central common component.
- Supporting Material: Additional directories like “docs”, “data”, “tutorials”, and “lab” suggest the presence of documentation, sample data, and guidance for setting up the development environment and dependency analysis.

##### File Structure and Relationships
- There is a grouping aspect – many labs are numbered (like “1_mmult”, “2_aos_soa”, “3_primary_nums”, “4_vector_functions”, etc.) as well as an additional “LABS” folder (with SR1 and SR2) which may represent more comprehensive or later-stage lab assignments.
- The “tutorials” and documentation files (“Lab1.md”, “Lab2.md”, etc.) serve as guides to help users understand environment setup and the conceptual background. They are not executables but indicate dependencies for understanding or setting up experiments.
- The “data” directory (with its “new” subdirectory) is likely used as input for some labs.

a. Main Modules (Rectangles):
- Out each lab as separate blocks: for example:
- 1_mmult (Matrix multiplication lab)
- 2_aos_soa (Memory layout experiments comparing AOS vs. SOA)
- 3_primary_nums (Prime number experiment)
- 4_vector_functions, 4_vector_map, 4_vector_remainder (Different vectorization experiments)
- LABS (grouped further into SR1 and SR2)
- n_vector (vectorization and data-parallel experiments)
- n-body-example (simulation example)
- sycl_example (SYCL-based experiment for heterogeneous computing)
b. Common Build and Configuration:
c. Supporting Resources:

##### Architectural Patterns and Design Principles
- Each lab is essentially an independent module following a similar pattern—a C++ source coupled with a CMake configuration for building. This modular approach reflects a component-based design.
- The separation between lab exercises themselves and shared resources (such as build scripts and tutorials) is an element of separation of concerns.

## Diagram (Mermaid)

```mermaid
flowchart TD
    PR["Lab Repository"]:::support
    TD["Tutorials & Documentation"]:::support
    DR["Data Resources"]:::support
    CS["CMake Build System"]:::infra
    LE["Lab Examples"]:::support

    PR --> TD
    PR --> DR
    PR --> CS
    PR --> LE

    subgraph "Basic Labs"
        MM["1_mmult"]:::lab
        AOS["2_aos_soa"]:::lab
        PN["3_primary_nums"]:::lab
        VF["4_vector_functions"]:::lab
        VM["4_vector_map"]:::lab
        VR["4_vector_remainder"]:::lab
    end

    subgraph "Advanced Labs"
        LABS["LABS"]:::lab
        NV["n_vector"]:::lab
        NB["n-body-example"]:::lab
        SY["sycl_example"]:::lab
        LABS --> SR1["LABS SR1"]:::lab
        LABS --> SR2["LABS SR2"]:::lab
    end

    %% Build system dependencies
    MM -->|"build"| CS
    AOS -->|"build"| CS
    PN -->|"build"| CS
    VF -->|"build"| CS
    VM -->|"build"| CS
    VR -->|"build"| CS
    LABS -->|"build"| CS
    NV -->|"build"| CS
    NB -->|"build"| CS
    SY -->|"build"| CS

    %% Tutorials and Lab Examples connections
    TD --> MM
    TD --> LABS
    TD --> LE

    %% Data Resources connection (example for simulation)
    DR --> NB

    %% Click Events
    click MM "https://github.com/llanskoyll/ehc-labs/blob/main/1_mmult/CMakeLists.txt"
    click AOS "https://github.com/llanskoyll/ehc-labs/blob/main/2_aos_soa/CMakeLists.txt"
    click PN "https://github.com/llanskoyll/ehc-labs/blob/main/3_primary_nums/CMakeLists.txt"
    click VF "https://github.com/llanskoyll/ehc-labs/blob/main/4_vector_functions/CMakeLists.txt"
    click VM "https://github.com/llanskoyll/ehc-labs/blob/main/4_vector_map/CMakeLists.txt"
    click VR "https://github.com/llanskoyll/ehc-labs/blob/main/4_vector_remainder/CMakeLists.txt"
    click LABS "https://github.com/llanskoyll/ehc-labs/blob/main/LABS/CMakeLists.txt"
    click SR1 "https://github.com/llanskoyll/ehc-labs/blob/main/LABS/SR1/CMakeLists.txt"
    click SR2 "https://github.com/llanskoyll/ehc-labs/blob/main/LABS/SR2/sle_solve.cpp"
    click NV "https://github.com/llanskoyll/ehc-labs/blob/main/n_vector/CMakeLists.txt"
    click NB "https://github.com/llanskoyll/ehc-labs/tree/main/n-body-example/"
    click SY "https://github.com/llanskoyll/ehc-labs/blob/main/sycl_example/CMakeLists.txt"
    click CS "https://github.com/llanskoyll/ehc-labs/blob/main/CMakeLists.txt"
    click TD "https://github.com/llanskoyll/ehc-labs/tree/main/tutorials/"
    click LE "https://github.com/llanskoyll/ehc-labs/blob/main/lab/lab1/CMakeLists.txt"
    click DR "https://github.com/llanskoyll/ehc-labs/tree/main/data/"

    %% Styles
    classDef lab fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef support fill:#ccffcc,stroke:#009900,stroke-width:2px;
    classDef infra fill:#ccccff,stroke:#000099,stroke-width:2px;
```
