# rstarzl/cmu-lib architecture

> Architecture diagram of the GitHub repository rstarzl/cmu-lib, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rstarzl/cmu-lib
- Repository: https://github.com/rstarzl/cmu-lib

## Overview

##### Project type and purpose
- This is an open-source, multi-module “CMU-Lib” toolkit for high-performance big-data processing. It bundles:
- MATLAB data-generation and SVD prototypes (Data_Generator, SVD_matlab)
- A core Java matrix library (CoolMatrixUtility) built atop MTJ
- A Java communication middleware (communication) for Master–Slave messaging
- A Java data-transmit middleware (data_transmit_midware) for buffering, caching and request handling
- A dummy distributed system simulator (DummySystem) to drive and test the above libraries
- A simple static website for demos

##### File structure
- Top-level modules correspond to functional layers.
- Data_Generator, SVD_matlab: MATLAB scripts for input data and prototyping
- communication: low-level packet/Message/MiddleWare API
- data_transmit_midware: higher-level controller/model/utils on top of communication
- CoolMatrixUtility: core matrix classes (Mat, MatOp) and SVD decomposition distributed across Master/Slave
- DummySystem: sample Master/Slave applications using both middlewares and CoolMatrixUtility

##### README
- Confirms positioning as “Next Generation Big Data Platform,” focusing on performance and ease-of-use.

##### Final advice
- Interactions: method calls, network packets, file I/O.
- Build artifacts (JARs, .m scripts) as endpoints.
- Keep it high-level but include all essential layers to reflect the toolkit’s modular design.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Generation Layer
    subgraph "Data Generation Layer"
        DG["Data Generator (.m scripts)"]:::data
        SV["SVD Prototypes (.m scripts)"]:::data
    end

    %% Core Computation Library
    subgraph "Core Computation Library" 
        CM["CoolMatrixUtility"]:::compute
        Mat["Mat.java"]:::compute
        MatOp["MatOp.java"]:::compute
        MSVD["Master_SVD.java"]:::compute
        MSplit["Master_Spliter.java"]:::compute
        SSVd["Slave_SVD.java"]:::compute
        SSplit["Slave_getSplitedMatrix.java"]:::compute
    end

    %% Data-Transmit Middleware
    subgraph "Data-Transmit Middleware"
        DD["DataDistributor.java"]:::middleware
        RH["RequestHandler.java"]:::middleware
        DB["DataBuffer.java"]:::middleware
        DS["DataSerializer.java"]:::middleware
    end

    %% Communication Middleware
    subgraph "Communication Middleware"
        MW["MiddleWare.java"]:::middleware
        PH["PacketHandler.java"]:::middleware
        MSG["Message.java"]:::middleware
        MN["MasterNode.java"]:::middleware
        SN["SlaveNode.java"]:::middleware
    end

    %% Application Layer / Simulator
    subgraph "Application Layer / Simulator"
        AP["DummySystem"]:::app
        Mst["Master.java"]:::app
        Slv["Slave.java"]:::app
        AMW["MasterMiddleWare.java"]:::app
        ASW["SlaveMiddleWare.java"]:::app
        RS["run.sh"]:::app
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        HTML["sample.html"]:::web
        CSS["custom.css"]:::web
        JQ["jquery.js"]:::web
        GA["ga.js"]:::web
    end

    %% Connections
    DG -->|"provides data"| CM
    SV -->|"prototyping input"| CM
    CM -->|"uses splitting"| MSplit
    MSplit -->|"sends chunks via"| DD
    DD -->|"buffers & routes"| MW
    MW -->|"packets to"| SN
    SN -->|"calls local SVD"| SSVd
    SSVd -->|"returns results"| MW
    MW -->|"forwards results"| CM
    AP -->|"invokes MasterMiddleWare"| AMW
    AP -->|"invokes SlaveMiddleWare"| ASW
    AMW --> MW
    ASW --> SN
    AP --> CM
    AP --> DD
    RS --> HTML
    HTML --> JQ
    HTML --> CSS
    HTML --> GA

    %% Click Events
    click DG "https://github.com/rstarzl/cmu-lib/tree/master/Data_Generator/"
    click SV "https://github.com/rstarzl/cmu-lib/tree/master/SVD_matlab/"
    click Mat "https://github.com/rstarzl/cmu-lib/blob/master/CoolMatrixUtility/src/cmu/core/Mat.java"
    click MatOp "https://github.com/rstarzl/cmu-lib/blob/master/CoolMatrixUtility/src/cmu/core/MatOp.java"
    click MSVD "https://github.com/rstarzl/cmu-lib/blob/master/CoolMatrixUtility/src/cmu/decomp/svd/Master_SVD.java"
    click MSplit "https://github.com/rstarzl/cmu-lib/blob/master/CoolMatrixUtility/src/cmu/decomp/svd/Master_Spliter.java"
    click SSVd "https://github.com/rstarzl/cmu-lib/blob/master/CoolMatrixUtility/src/cmu/decomp/svd/Slave_SVD.java"
    click SSplit "https://github.com/rstarzl/cmu-lib/blob/master/CoolMatrixUtility/src/cmu/decomp/svd/Slave_getSplitedMatrix.java"
    click MW "https://github.com/rstarzl/cmu-lib/blob/master/communication/src/edu/cmu/cmulib/communication/MiddleWare.java"
    click PH "https://github.com/rstarzl/cmu-lib/blob/master/communication/src/edu/cmu/cmulib/communication/PacketHandler.java"
    click MSG "https://github.com/rstarzl/cmu-lib/blob/master/communication/src/edu/cmu/cmulib/communication/Message.java"
    click MN "https://github.com/rstarzl/cmu-lib/blob/master/communication/src/edu/cmu/cmulib/communication/MasterNode.java"
    click SN "https://github.com/rstarzl/cmu-lib/blob/master/communication/src/edu/cmu/cmulib/communication/SlaveNode.java"
    click DD "https://github.com/rstarzl/cmu-lib/blob/master/data_transmit_midware/src/edu/cmu/cmulib/controller/DataDistributor.java"
    click RH "https://github.com/rstarzl/cmu-lib/blob/master/data_transmit_midware/src/edu/cmu/cmulib/controller/RequestHandler.java"
    click DB "https://github.com/rstarzl/cmu-lib/blob/master/data_transmit_midware/src/edu/cmu/cmulib/model/DataBuffer.java"
    click DS "https://github.com/rstarzl/cmu-lib/blob/master/data_transmit_midware/src/edu/cmu/cmulib/utils/DataSerializer.java"
    click Mst "https://github.com/rstarzl/cmu-lib/blob/master/DummySystem/src/Master.java"
    click Slv "https://github.com/rstarzl/cmu-lib/blob/master/DummySystem/src/Slave.java"
    click AMW "https://github.com/rstarzl/cmu-lib/blob/master/DummySystem/src/MasterMiddleWare.java"
    click ASW "https://github.com/rstarzl/cmu-lib/blob/master/DummySystem/src/SlaveMiddleWare.java"
    click RS "https://github.com/rstarzl/cmu-lib/blob/master/DummySystem/run.sh"
    click HTML "https://github.com/rstarzl/cmu-lib/blob/master/website/sample.html"
    click CSS "https://github.com/rstarzl/cmu-lib/blob/master/website/css/custom.css"
    click JQ "https://github.com/rstarzl/cmu-lib/blob/master/website/src/jquery.js"
    click GA "https://github.com/rstarzl/cmu-lib/blob/master/website/src/ga.js"

    %% Styles
    classDef data fill:#a8f0a1,stroke:#333,stroke-width:1px
    classDef compute fill:#a1d0f0,stroke:#333,stroke-width:1px
    classDef middleware fill:#f0b27a,stroke:#333,stroke-width:1px
    classDef app fill:#d2b4de,stroke:#333,stroke-width:1px
    classDef web fill:#d5dbdb,stroke:#333,stroke-width:1px
```
