# acridgold/opplabsnsu architecture

> Architecture diagram of the GitHub repository acridgold/opplabsnsu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/acridgold/opplabsnsu
- Repository: https://github.com/acridgold/opplabsnsu

## Overview

This repository is a collection of NSU C++ parallel-computing labs, not one integrated application. The main workflow varies by lab: run a sequential, MPI, or OpenMP implementation to compute a result and report timing or convergence. The README marks labs 1–5 done; lab 6 is present but not listed as done. The graph preserves the distinct computational exercises. Some source is unsampled, so links for those implementations are omitted rather than inferred.

Main entry points: [`lab3/src/gen.cpp`](https://github.com/acridgold/opplabsnsu/blob/master/lab3/src/gen.cpp) (System generator), [`lab1/input.txt`](https://github.com/acridgold/opplabsnsu/blob/master/lab1/input.txt) (Input vectors), [`lab1/a/src/main.cpp`](https://github.com/acridgold/opplabsnsu/blob/master/lab1/a/src/main.cpp) (Sequential sum), [`lab1/b/src/main.cpp`](https://github.com/acridgold/opplabsnsu/blob/master/lab1/b/src/main.cpp) (MPI sum: sends)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Lab 1: Sum"]
  node_lab1_input["Input vectors<br/>[input.txt]"]
  node_sum_seq["Sequential sum<br/>[main.cpp]"]
  node_sum_mpi_send["MPI sum: sends<br/>[main.cpp]"]
  node_sum_mpi_reduce["MPI sum: reduce<br/>[main.cpp]"]
end

subgraph group_g2["Labs 2–3: Solvers"]
  node_solver_mpi["MPI solver<br/>[mpi.cpp]"]
  node_solver_seq["Sequential solver<br/>[seq.cpp]"]
  node_matrix_generator["System generator<br/>[gen.cpp]"]
  node_solver_omp["OpenMP solver<br/>[omp.cpp]"]
end

subgraph group_g3["Lab 4: Matmul"]
  node_matmul_setup["Grid and distribution<br/>[main.cpp]"]
  node_matmul_compute["Local multiplication<br/>[main.cpp]"]
  node_matmul_result["Gather and verify<br/>[main.cpp]"]
end

subgraph group_g4["Lab 5: Life"]
  node_life_seq["Sequential Life<br/>[Life_seq.cpp]"]
  node_life_mpi["Distributed Life<br/>[Life_mpi.cpp]"]
  node_life_output["Final grid<br/>[Life_mpi.cpp]"]
end

subgraph group_g5["Lab 6: Scheduling"]
  node_task_runtime["MPI thread scheduler<br/>[mpi.cpp]"]
end

node_user(("Lab runner"))

node_user -->|"runs"| node_sum_seq
node_user -->|"runs"| node_sum_mpi_send
node_user -->|"runs"| node_sum_mpi_reduce
node_sum_seq -->|"reads"| node_lab1_input
node_sum_mpi_send -->|"reads"| node_lab1_input
node_sum_mpi_reduce -->|"reads"| node_lab1_input
node_user -->|"runs"| node_solver_mpi
node_user -->|"runs"| node_solver_seq
node_user -->|"runs"| node_matrix_generator
node_matrix_generator -->|"writes solver inputs"| node_solver_omp
node_solver_omp -->|"reads generated files"| node_matrix_generator
node_user -->|"runs"| node_matmul_setup
node_matmul_setup -->|"broadcasts matrix strips"| node_matmul_compute
node_matmul_compute -->|"sends local results"| node_matmul_result
node_user -->|"runs"| node_life_seq
node_user -->|"runs"| node_life_mpi
node_life_mpi -->|"writes final grid"| node_life_output
node_user -->|"runs"| node_task_runtime

click node_lab1_input "https://github.com/acridgold/opplabsnsu/blob/master/lab1/input.txt"
click node_sum_seq "https://github.com/acridgold/opplabsnsu/blob/master/lab1/a/src/main.cpp"
click node_sum_mpi_send "https://github.com/acridgold/opplabsnsu/blob/master/lab1/b/src/main.cpp"
click node_sum_mpi_reduce "https://github.com/acridgold/opplabsnsu/blob/master/lab1/c/src/main.cpp"
click node_solver_mpi "https://github.com/acridgold/opplabsnsu/blob/master/lab2/a/mpi.cpp"
click node_solver_seq "https://github.com/acridgold/opplabsnsu/blob/master/lab2/a/seq.cpp"
click node_matrix_generator "https://github.com/acridgold/opplabsnsu/blob/master/lab3/src/gen.cpp"
click node_solver_omp "https://github.com/acridgold/opplabsnsu/blob/master/lab3/src/omp.cpp"
click node_matmul_setup "https://github.com/acridgold/opplabsnsu/blob/master/lab4/src/main.cpp"
click node_matmul_compute "https://github.com/acridgold/opplabsnsu/blob/master/lab4/src/main.cpp"
click node_matmul_result "https://github.com/acridgold/opplabsnsu/blob/master/lab4/src/main.cpp"
click node_life_seq "https://github.com/acridgold/opplabsnsu/blob/master/lab5/src/Life_seq.cpp"
click node_life_mpi "https://github.com/acridgold/opplabsnsu/blob/master/lab5/src/Life_mpi.cpp"
click node_life_output "https://github.com/acridgold/opplabsnsu/blob/master/lab5/src/Life_mpi.cpp"
click node_task_runtime "https://github.com/acridgold/opplabsnsu/blob/master/lab6/src/mpi.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lab1_input,node_sum_seq,node_sum_mpi_send,node_sum_mpi_reduce toneBlue
class node_solver_mpi,node_solver_seq,node_matrix_generator,node_solver_omp toneAmber
class node_matmul_setup,node_matmul_compute,node_matmul_result toneMint
class node_life_seq,node_life_mpi,node_life_output toneRose
class node_task_runtime,node_user toneIndigo
```

## Components

### Lab 1: Sum

- [Input vectors](https://github.com/acridgold/opplabsnsu/blob/master/lab1/input.txt): `lab1/input.txt`
- [Sequential sum](https://github.com/acridgold/opplabsnsu/blob/master/lab1/a/src/main.cpp): `lab1/a/src/main.cpp`
- [MPI sum: sends](https://github.com/acridgold/opplabsnsu/blob/master/lab1/b/src/main.cpp): `lab1/b/src/main.cpp`
- [MPI sum: reduce](https://github.com/acridgold/opplabsnsu/blob/master/lab1/c/src/main.cpp): `lab1/c/src/main.cpp`

### Labs 2–3: Solvers

- [MPI solver](https://github.com/acridgold/opplabsnsu/blob/master/lab2/a/mpi.cpp): `lab2/a/mpi.cpp`
- [Sequential solver](https://github.com/acridgold/opplabsnsu/blob/master/lab2/a/seq.cpp): `lab2/a/seq.cpp`
- [System generator](https://github.com/acridgold/opplabsnsu/blob/master/lab3/src/gen.cpp): `lab3/src/gen.cpp`
- [OpenMP solver](https://github.com/acridgold/opplabsnsu/blob/master/lab3/src/omp.cpp): `lab3/src/omp.cpp`

### Lab 4: Matmul

- [Grid and distribution](https://github.com/acridgold/opplabsnsu/blob/master/lab4/src/main.cpp): `lab4/src/main.cpp`
- [Local multiplication](https://github.com/acridgold/opplabsnsu/blob/master/lab4/src/main.cpp): `lab4/src/main.cpp`
- [Gather and verify](https://github.com/acridgold/opplabsnsu/blob/master/lab4/src/main.cpp): `lab4/src/main.cpp`

### Lab 5: Life

- [Sequential Life](https://github.com/acridgold/opplabsnsu/blob/master/lab5/src/Life_seq.cpp): `lab5/src/Life_seq.cpp`
- [Distributed Life](https://github.com/acridgold/opplabsnsu/blob/master/lab5/src/Life_mpi.cpp): `lab5/src/Life_mpi.cpp`
- [Final grid](https://github.com/acridgold/opplabsnsu/blob/master/lab5/src/Life_mpi.cpp): `lab5/src/Life_mpi.cpp`

### Lab 6: Scheduling

- [MPI thread scheduler](https://github.com/acridgold/opplabsnsu/blob/master/lab6/src/mpi.cpp): `lab6/src/mpi.cpp`

### Other components

- **Lab runner**

## Connections

- Lab runner → Sequential sum: runs
- Lab runner → MPI sum: sends: runs
- Lab runner → MPI sum: reduce: runs
- Sequential sum → Input vectors: reads (evidence: `lab1/a/src/main.cpp`)
- MPI sum: sends → Input vectors: reads (evidence: `lab1/b/src/main.cpp`)
- MPI sum: reduce → Input vectors: reads (evidence: `lab1/c/src/main.cpp`)
- Lab runner → MPI solver: runs
- Lab runner → Sequential solver: runs
- Lab runner → System generator: runs
- System generator → OpenMP solver: writes solver inputs (evidence: `lab3/src/gen.cpp`)
- OpenMP solver → System generator: reads generated files (evidence: `lab3/src/omp.cpp`)
- Lab runner → Grid and distribution: runs
- Grid and distribution → Local multiplication: broadcasts matrix strips (evidence: `lab4/src/main.cpp`)
- Local multiplication → Gather and verify: sends local results (evidence: `lab4/src/main.cpp`)
- Lab runner → Sequential Life: runs
- Lab runner → Distributed Life: runs
- Distributed Life → Final grid: writes final grid (evidence: `lab5/src/Life_mpi.cpp`)
- Lab runner → MPI thread scheduler: runs
