# kameelz/dragonfly-allreduce-sim architecture

> Architecture diagram of the GitHub repository kameelz/dragonfly-allreduce-sim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kameelz/dragonfly-allreduce-sim
- Repository: https://github.com/kameelz/dragonfly-allreduce-sim

## Overview

This repository evaluates topology-aware g-PAARD all-reduce on Mininet Dragonfly and Dragonfly+ networks. The main workflow builds a topology, installs routing, selects and runs an all-reduce schedule as concurrent TCP flows, then reports completion and performance metrics. Experiments extend that workflow with parameter sweeps and link-utilization measurements. Sampled excerpts establish the benchmark, topology, schedule, and measurement responsibilities; several experiment variants are represented by their indexed paths, with relationships omitted where call details were not sampled.

Main entry points: [`benchmark_gpaard.py`](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py) (Benchmark runner), [`dragonfly_topo.py`](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_topo.py) (Dragonfly topology), [`verify_gpaard_correctness.py`](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/verify_gpaard_correctness.py) (Correctness verifier), [`dragonfly_plus_topo.py`](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_plus_topo.py) (Dragonfly+ topology)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_topology["Network topologies"]
  node_df_topology["Dragonfly topology<br/>[dragonfly_topo.py]"]
  node_dfplus_topology["Dragonfly+ topology"]
  node_routing["Routing and ECMP<br/>[dragonfly_topo.py]"]
end

subgraph group_algorithm["All-reduce execution"]
  node_benchmark["Benchmark runner"]
  node_schedule["g-PAARD schedules<br/>[gpaard.py]"]
  node_traffic["TCP flow runner"]
  node_adaptive["Adaptive selector"]
end

subgraph group_measurement["Measurement and analysis"]
  node_metrics["Timing and FCT"]
  node_correctness["Correctness verifier"]
  node_link_util["Link utilization"]
  node_visualize["Topology visualization"]
end

subgraph group_experiments["Experiment suites"]
  node_sweep_common["Shared sweep engine<br/>[sweep_common.py]"]
  node_bandwidth_sweep["Bandwidth sweep"]
  node_asymmetric_sweep["Asymmetric-group sweep"]
  node_comparison["Final topology comparison"]
  node_big_sweep["Large-topology sweep"]
  node_topology_sweep["Topology sweep"]
end

node_user(("Researcher"))
node_mininet{{"Mininet network"}}
node_iperf{{"iperf TCP traffic"}}

node_user -->|"runs benchmark"| node_benchmark
node_user -->|"builds network"| node_df_topology
node_benchmark -->|"builds topology"| node_df_topology
node_benchmark -->|"runs schedule"| node_schedule
node_benchmark -->|"launches flows"| node_traffic
node_traffic -->|"starts clients"| node_iperf
node_benchmark -->|"selects pattern"| node_adaptive
node_adaptive -->|"chooses schedule"| node_schedule
node_benchmark -->|"collects timings"| node_metrics
node_df_topology -->|"installs routes"| node_routing
node_df_topology -->|"supports topology"| node_dfplus_topology
node_benchmark -->|"runs network"| node_mininet
node_correctness -->|"checks topology"| node_df_topology
node_correctness -->|"checks topology"| node_dfplus_topology
node_correctness -->|"checks result"| node_schedule
node_visualize -->|"draws topology"| node_df_topology
node_visualize -->|"draws topology"| node_dfplus_topology
node_link_util -->|"samples interfaces"| node_mininet
node_sweep_common -->|"runs patterns"| node_benchmark
node_sweep_common -->|"measures links"| node_link_util
node_bandwidth_sweep -->|"benchmarks sizes"| node_benchmark
node_asymmetric_sweep -->|"compares networks"| node_benchmark
node_comparison -->|"compares networks"| node_benchmark
node_big_sweep -->|"runs sweeps"| node_benchmark
node_topology_sweep -->|"runs sweeps"| node_benchmark

click node_benchmark "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py"
click node_schedule "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/gpaard.py"
click node_traffic "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py"
click node_adaptive "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py"
click node_df_topology "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_topo.py"
click node_dfplus_topology "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_plus_topo.py"
click node_routing "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_topo.py"
click node_metrics "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py"
click node_correctness "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/verify_gpaard_correctness.py"
click node_link_util "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/link_utilization.py"
click node_visualize "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/visualize_dragonfly_topo.py"
click node_sweep_common "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/sweep_common.py"
click node_bandwidth_sweep "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_bandwidth_sweep.py"
click node_asymmetric_sweep "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_asymmetric_groups.py"
click node_comparison "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_df_vs_dfplus.py"
click node_big_sweep "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/sweep_big_topology.py"
click node_topology_sweep "https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_topology_sweep.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_df_topology,node_dfplus_topology,node_routing toneBlue
class node_benchmark,node_schedule,node_traffic,node_adaptive toneAmber
class node_metrics,node_correctness,node_link_util,node_visualize toneMint
class node_sweep_common,node_bandwidth_sweep,node_asymmetric_sweep,node_comparison,node_big_sweep,node_topology_sweep toneRose
class node_user,node_mininet,node_iperf toneIndigo
```

## Components

### Network topologies

- [Dragonfly topology](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_topo.py): `dragonfly_topo.py`
- [Dragonfly+ topology](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_plus_topo.py): `dragonfly_plus_topo.py`
- [Routing and ECMP](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/dragonfly_topo.py): `dragonfly_topo.py`

### All-reduce execution

- [Benchmark runner](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py): `benchmark_gpaard.py`
- [g-PAARD schedules](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/gpaard.py): `gpaard.py`
- [TCP flow runner](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py): `benchmark_gpaard.py`
- [Adaptive selector](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py): `benchmark_gpaard.py`

### Measurement and analysis

- [Timing and FCT](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/benchmark_gpaard.py): `benchmark_gpaard.py`
- [Correctness verifier](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/verify_gpaard_correctness.py): `verify_gpaard_correctness.py`
- [Link utilization](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/link_utilization.py): `experiments/link_utilization.py`
- [Topology visualization](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/visualize_dragonfly_topo.py): `visualize_dragonfly_topo.py`

### Experiment suites

- [Shared sweep engine](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/sweep_common.py): `experiments/sweep_common.py`
- [Bandwidth sweep](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_bandwidth_sweep.py): `experiments/benchmark_bandwidth_sweep.py`
- [Asymmetric-group sweep](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_asymmetric_groups.py): `experiments/benchmark_asymmetric_groups.py`
- [Final topology comparison](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_df_vs_dfplus.py): `experiments/benchmark_df_vs_dfplus.py`
- [Large-topology sweep](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/sweep_big_topology.py): `experiments/sweep_big_topology.py`
- [Topology sweep](https://github.com/kameelz/dragonfly-allreduce-sim/blob/main/experiments/benchmark_topology_sweep.py): `experiments/benchmark_topology_sweep.py`

### Other components

- **Researcher**
- **Mininet network**
- **iperf TCP traffic**

## Connections

- Researcher → Benchmark runner: runs benchmark (evidence: `README.md`)
- Researcher → Dragonfly topology: builds network (evidence: `README.md`)
- Benchmark runner → Dragonfly topology: builds topology (evidence: `benchmark_gpaard.py`)
- Benchmark runner → g-PAARD schedules: runs schedule (evidence: `benchmark_gpaard.py`)
- Benchmark runner → TCP flow runner: launches flows (evidence: `benchmark_gpaard.py`)
- TCP flow runner → iperf TCP traffic: starts clients (evidence: `benchmark_gpaard.py`)
- Benchmark runner → Adaptive selector: selects pattern (evidence: `README.md`)
- Adaptive selector → g-PAARD schedules: chooses schedule (evidence: `README.md`)
- Benchmark runner → Timing and FCT: collects timings (evidence: `benchmark_gpaard.py`)
- Dragonfly topology → Routing and ECMP: installs routes (evidence: `dragonfly_topo.py`)
- Dragonfly topology → Dragonfly+ topology: supports topology (evidence: `dragonfly_topo.py`)
- Benchmark runner → Mininet network: runs network (evidence: `README.md`)
- Correctness verifier → Dragonfly topology: checks topology (evidence: `verify_gpaard_correctness.py`)
- Correctness verifier → Dragonfly+ topology: checks topology (evidence: `verify_gpaard_correctness.py`)
- Correctness verifier → g-PAARD schedules: checks result (evidence: `verify_gpaard_correctness.py`)
- Topology visualization → Dragonfly topology: draws topology (evidence: `visualize_dragonfly_topo.py`)
- Topology visualization → Dragonfly+ topology: draws topology (evidence: `visualize_dragonfly_topo.py`)
- Link utilization → Mininet network: samples interfaces (evidence: `experiments/link_utilization.py`)
- Shared sweep engine → Benchmark runner: runs patterns (evidence: `experiments/sweep_common.py`)
- Shared sweep engine → Link utilization: measures links (evidence: `experiments/sweep_common.py`)
- Bandwidth sweep → Benchmark runner: benchmarks sizes (evidence: `experiments/benchmark_bandwidth_sweep.py`)
- Asymmetric-group sweep → Benchmark runner: compares networks (evidence: `experiments/benchmark_asymmetric_groups.py`)
- Final topology comparison → Benchmark runner: compares networks (evidence: `experiments/benchmark_df_vs_dfplus.py`)
- Large-topology sweep → Benchmark runner: runs sweeps (evidence: `experiments/sweep_big_topology.py`)
- Topology sweep → Benchmark runner: runs sweeps (evidence: `experiments/benchmark_topology_sweep.py`)
