# vchaitrad/pgc-lab-evaluation-1 architecture

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

- Interactive diagram: https://gitdiagram.com/vchaitrad/pgc-lab-evaluation-1
- Repository: https://github.com/vchaitrad/pgc-lab-evaluation-1

## Overview

This lab compares vector addition across serial CPU, OpenMP, and CUDA implementations, then presents execution-time comparisons. The main workflow is to run the CPU and GPU benchmarks for three array sizes, capture their timings, and generate a comparison chart. The OpenMP implementation is shown in source; CUDA behavior and run-to-result relationships are documented in the README, but the CUDA source was not excerpted. The chart script uses embedded timing values rather than reading the result files.

Main entry points: [`cpu_vs_gpu.cu`](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cpu_vs_gpu.cu) (CPU + CUDA), [`cpu_openmp.c`](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cpu_openmp.c) (Serial + OpenMP), [`plot_graph.py`](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/plot_graph.py) (Timing chart generator), [`openmp_results.txt`](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/openmp_results.txt) (OpenMP timings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_benchmarks["Benchmarks"]
  node_openmp["Serial + OpenMP<br/>[cpu_openmp.c]"]
  node_cuda["CPU + CUDA<br/>[cpu_vs_gpu.cu]"]
  node_gpu["Tesla T4 GPU"]
end

subgraph group_results["Results"]
  node_ompdata["OpenMP timings<br/>[openmp_results.txt]"]
  node_cudadata["CUDA run timings<br/>[cuda_results.txt]"]
end

subgraph group_reporting["Reporting"]
  node_plotter["Timing chart generator<br/>[plot_graph.py]"]
end

node_runner(("Lab user"))

node_runner -->|"runs benchmark"| node_openmp
node_runner -->|"runs benchmark"| node_cuda
node_cuda -->|"runs kernel"| node_gpu
node_openmp -->|"writes timings"| node_ompdata
node_cuda -->|"writes timings"| node_cudadata
node_plotter -->|"saves chart"| node_runner

click node_openmp "https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cpu_openmp.c"
click node_cuda "https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cpu_vs_gpu.cu"
click node_ompdata "https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/openmp_results.txt"
click node_cudadata "https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cuda_results.txt"
click node_plotter "https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/plot_graph.py"

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_openmp,node_cuda,node_gpu,node_runner toneBlue
class node_ompdata,node_cudadata toneAmber
class node_plotter toneMint
```

## Components

### Benchmarks

- [Serial + OpenMP](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cpu_openmp.c): `cpu_openmp.c`
- [CPU + CUDA](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cpu_vs_gpu.cu): `cpu_vs_gpu.cu`
- **Tesla T4 GPU**

### Results

- [OpenMP timings](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/openmp_results.txt): `openmp_results.txt`
- [CUDA run timings](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/cuda_results.txt): `cuda_results.txt`

### Reporting

- [Timing chart generator](https://github.com/vchaitrad/pgc-lab-evaluation-1/blob/main/plot_graph.py): `plot_graph.py`

### Other components

- **Lab user**

## Connections

- Lab user → Serial + OpenMP: runs benchmark (evidence: `README.md`)
- Lab user → CPU + CUDA: runs benchmark (evidence: `README.md`)
- CPU + CUDA → Tesla T4 GPU: runs kernel (evidence: `README.md`)
- Serial + OpenMP → OpenMP timings: writes timings (evidence: `README.md`)
- CPU + CUDA → CUDA run timings: writes timings (evidence: `README.md`)
- Timing chart generator → Lab user: saves chart (evidence: `plot_graph.py`)
