# charl024/lrp_dvs_mpi architecture

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

- Interactive diagram: https://gitdiagram.com/charl024/lrp_dvs_mpi
- Repository: https://github.com/charl024/lrp_dvs_mpi

## Overview

This is a demonstration application for processing prerecorded neuromorphic-camera event streams, comparing serial execution with MPI-parallel processing. Users select a serial or MPI entry point; it loads datasets, runs heatmap, background-filtering, and HATS algorithms, and can visualize their results. The parallel algorithms distribute packets by image region and gather or reduce rank-local results. The README describes the project’s purpose but provides few implementation details; unsampled serial modules and dataset-loading behavior are represented only where supported by the file tree and sampled callers.

Main entry points: [`src/processing.py`](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/processing.py) (Core processing), [`src/main_serial.py`](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_serial.py) (Serial runner), [`src/main_serial_v2.py`](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_serial_v2.py) (Serial runner v2), [`src/main_parallel.py`](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_parallel.py) (MPI runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry points"]
  node_serial_main["Serial runner<br/>[main_serial.py]"]
  node_serial_v2["Serial runner v2<br/>[main_serial_v2.py]"]
  node_mpi_main["MPI runner<br/>[main_parallel.py]"]
  node_mpi_v2["MPI runner v2"]
end

subgraph group_input["Event input"]
  node_dataset_loader["Dataset loader<br/>[util.py]"]
  node_event_data["Event datasets"]
end

subgraph group_algorithms["Processing algorithms"]
  node_serial_heatmap["Serial heatmap<br/>[serial_heatmap.py]"]
  node_serial_filter["Serial background filter"]
  node_serial_hats["Serial HATS<br/>[serial_hats.py]"]
  node_parallel_heatmap["MPI heatmap"]
  node_parallel_filter["MPI background filter"]
  node_parallel_hats["MPI HATS<br/>[parallel_hats.py]"]
  node_processing["Core processing<br/>[processing.py]"]
end

subgraph group_results["Results and visualization"]
  node_serial_plots["Serial visualizations"]
  node_parallel_plots["MPI visualizations"]
end

node_user(("User"))
node_mpi_ranks(("MPI ranks"))

node_user -->|"runs serial"| node_serial_main
node_user -->|"runs serial v2"| node_serial_v2
node_user -->|"runs MPI"| node_mpi_main
node_user -->|"runs MPI v2"| node_mpi_v2
node_serial_main -->|"loads datasets"| node_dataset_loader
node_serial_v2 -->|"loads datasets"| node_dataset_loader
node_mpi_main -->|"loads datasets"| node_dataset_loader
node_mpi_v2 -->|"loads datasets"| node_dataset_loader
node_dataset_loader -->|"reads events"| node_event_data
node_serial_main -->|"calls"| node_serial_heatmap
node_serial_main -->|"calls"| node_serial_filter
node_serial_main -->|"calls"| node_serial_hats
node_serial_v2 -->|"calls"| node_serial_heatmap
node_serial_v2 -->|"calls"| node_serial_filter
node_serial_v2 -->|"calls"| node_serial_hats
node_mpi_main -->|"calls"| node_parallel_heatmap
node_mpi_main -->|"calls"| node_parallel_filter
node_mpi_main -->|"calls"| node_parallel_hats
node_mpi_v2 -->|"calls"| node_parallel_heatmap
node_mpi_v2 -->|"calls"| node_parallel_filter
node_mpi_v2 -->|"calls"| node_parallel_hats
node_serial_heatmap -->|"processes events"| node_processing
node_serial_filter -->|"filters events"| node_processing
node_serial_hats -->|"computes descriptors"| node_processing
node_parallel_heatmap -->|"processes events"| node_processing
node_parallel_filter -->|"filters events"| node_processing
node_parallel_hats -->|"computes descriptors"| node_processing
node_parallel_heatmap -->|"sends and gathers"| node_mpi_ranks
node_parallel_filter -->|"sends and gathers"| node_mpi_ranks
node_parallel_hats -->|"sends and reduces"| node_mpi_ranks
node_serial_filter -->|"writes plots"| node_serial_plots
node_serial_heatmap -.->|"writes plots"| node_serial_plots
node_serial_hats -.->|"writes plots"| node_serial_plots
node_parallel_heatmap -->|"writes plots"| node_parallel_plots
node_parallel_filter -->|"writes plots"| node_parallel_plots
node_parallel_hats -->|"writes plots"| node_parallel_plots

click node_serial_main "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_serial.py"
click node_serial_v2 "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_serial_v2.py"
click node_mpi_main "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_parallel.py"
click node_mpi_v2 "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_parallel_v2.py"
click node_dataset_loader "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/util.py"
click node_event_data "https://github.com/charl024/lrp_dvs_mpi/tree/main/test_data"
click node_serial_heatmap "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/serial_heatmap.py"
click node_serial_filter "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/serial_background_filter.py"
click node_serial_hats "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/serial_hats.py"
click node_parallel_heatmap "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/parallel_heatmap.py"
click node_parallel_filter "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/parallel_background_filter.py"
click node_parallel_hats "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/parallel_hats.py"
click node_processing "https://github.com/charl024/lrp_dvs_mpi/blob/main/src/processing.py"
click node_serial_plots "https://github.com/charl024/lrp_dvs_mpi/tree/main/plots/serial"
click node_parallel_plots "https://github.com/charl024/lrp_dvs_mpi/tree/main/plots/parallel"

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_serial_main,node_serial_v2,node_mpi_main,node_mpi_v2,node_user toneBlue
class node_dataset_loader,node_event_data toneAmber
class node_serial_heatmap,node_serial_filter,node_serial_hats,node_parallel_heatmap,node_parallel_filter,node_parallel_hats,node_processing toneMint
class node_serial_plots,node_parallel_plots toneRose
class node_mpi_ranks toneIndigo
```

## Components

### Application entry points

- [Serial runner](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_serial.py): `src/main_serial.py`
- [Serial runner v2](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_serial_v2.py): `src/main_serial_v2.py`
- [MPI runner](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_parallel.py): `src/main_parallel.py`
- [MPI runner v2](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/main_parallel_v2.py): `src/main_parallel_v2.py`

### Event input

- [Dataset loader](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/util.py): `src/util.py`
- [Event datasets](https://github.com/charl024/lrp_dvs_mpi/tree/main/test_data): `test_data`

### Processing algorithms

- [Serial heatmap](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/serial_heatmap.py): `src/serial_heatmap.py`
- [Serial background filter](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/serial_background_filter.py): `src/serial_background_filter.py`
- [Serial HATS](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/serial_hats.py): `src/serial_hats.py`
- [MPI heatmap](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/parallel_heatmap.py): `src/parallel_heatmap.py`
- [MPI background filter](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/parallel_background_filter.py): `src/parallel_background_filter.py`
- [MPI HATS](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/parallel_hats.py): `src/parallel_hats.py`
- [Core processing](https://github.com/charl024/lrp_dvs_mpi/blob/main/src/processing.py): `src/processing.py`

### Results and visualization

- [Serial visualizations](https://github.com/charl024/lrp_dvs_mpi/tree/main/plots/serial): `plots/serial`
- [MPI visualizations](https://github.com/charl024/lrp_dvs_mpi/tree/main/plots/parallel): `plots/parallel`

### Other components

- **User**
- **MPI ranks**

## Connections

- User → Serial runner: runs serial
- User → Serial runner v2: runs serial v2
- User → MPI runner: runs MPI
- User → MPI runner v2: runs MPI v2
- Serial runner → Dataset loader: loads datasets
- Serial runner v2 → Dataset loader: loads datasets
- MPI runner → Dataset loader: loads datasets
- MPI runner v2 → Dataset loader: loads datasets
- Dataset loader → Event datasets: reads events
- Serial runner → Serial heatmap: calls
- Serial runner → Serial background filter: calls
- Serial runner → Serial HATS: calls
- Serial runner v2 → Serial heatmap: calls
- Serial runner v2 → Serial background filter: calls
- Serial runner v2 → Serial HATS: calls
- MPI runner → MPI heatmap: calls
- MPI runner → MPI background filter: calls
- MPI runner → MPI HATS: calls
- MPI runner v2 → MPI heatmap: calls
- MPI runner v2 → MPI background filter: calls
- MPI runner v2 → MPI HATS: calls
- Serial heatmap → Core processing: processes events
- Serial background filter → Core processing: filters events
- Serial HATS → Core processing: computes descriptors
- MPI heatmap → Core processing: processes events
- MPI background filter → Core processing: filters events
- MPI HATS → Core processing: computes descriptors
- MPI heatmap → MPI ranks: sends and gathers
- MPI background filter → MPI ranks: sends and gathers
- MPI HATS → MPI ranks: sends and reduces
- Serial background filter → Serial visualizations: writes plots
- Serial heatmap → Serial visualizations: writes plots
- Serial HATS → Serial visualizations: writes plots
- MPI heatmap → MPI visualizations: writes plots
- MPI background filter → MPI visualizations: writes plots
- MPI HATS → MPI visualizations: writes plots
