# darshan-hpc/darshan architecture

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

- Interactive diagram: https://gitdiagram.com/darshan-hpc/darshan
- Repository: https://github.com/darshan-hpc/darshan

## Overview

Darshan transparently instruments HPC application I/O, records measurements in logs, and provides utilities for inspecting and analyzing those logs. The principal workflow runs from an application through runtime instrumentation and log creation to command-line or Python analysis and reports. Runtime modules cover POSIX and MPI-IO, with additional tracing, heatmap, and hardware-counter capabilities. The README documents the runtime-to-utility handoff; several internal relationships are shown only where excerpts or the source index support them, so uncertain links are omitted.

Main entry points: [`darshan-runtime/lib/darshan-core.c`](https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan-core.c) (Runtime core), [`darshan-util/darshan-logutils.c`](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/darshan-logutils.c) (Log access), [`darshan-util/darshan-parser.c`](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/darshan-parser.c) (Text parser), [`darshan-util/pydarshan/darshan/cli/summary.py`](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/pydarshan/darshan/cli/summary.py) (Summary CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime capture"]
  node_core["Runtime core<br/>[darshan-core.c]"]
  node_runtime_api["Runtime interfaces<br/>[darshan.h]"]
end

subgraph group_modules["Instrumentation modules"]
  node_posix["POSIX I/O<br/>[darshan-posix.c]"]
  node_mpiio["MPI-IO<br/>[darshan-mpiio.c]"]
  node_apmpi["MPI profiling<br/>[darshan-apmpi.c]"]
  node_apss["System counters<br/>[darshan-apss.c]"]
  node_dxt_heatmap["Tracing and heatmaps"]
end

subgraph group_util["Log utilities"]
  node_log_format["Log format"]
  node_logutils["Log access<br/>[darshan-logutils.c]"]
  node_parser["Text parser<br/>[darshan-parser.c]"]
end

subgraph group_python["Python analysis"]
  node_cffi["Python backend<br/>[cffi_backend.py]"]
  node_report["Darshan report<br/>[report.py]"]
  node_summary["Summary CLI<br/>[summary.py]"]
  node_plots["Analysis plots"]
end

node_application(("HPC application"))
node_logfile[("Darshan log")]
node_analyst(("Analyst"))

node_application -->|"runs under"| node_core
node_core -->|"uses interfaces"| node_runtime_api
node_core -.->|"dispatches modules"| node_posix
node_core -.->|"dispatches modules"| node_mpiio
node_core -.->|"dispatches modules"| node_apmpi
node_core -.->|"dispatches modules"| node_apss
node_mpiio -->|"records tracing"| node_dxt_heatmap
node_core -->|"writes measurements"| node_logfile
node_logfile -->|"opens for analysis"| node_logutils
node_logutils -->|"uses format"| node_log_format
node_parser -->|"reads log data"| node_logutils
node_logfile -->|"is parsed by"| node_parser
node_logfile -->|"opens log"| node_cffi
node_cffi -->|"provides records"| node_report
node_report -->|"feeds summary"| node_summary
node_summary -->|"uses plotting"| node_plots
node_analyst -.->|"inspects logs"| node_parser
node_analyst -.->|"generates reports"| node_summary

click node_core "https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan-core.c"
click node_runtime_api "https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan.h"
click node_posix "https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan-posix.c"
click node_mpiio "https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan-mpiio.c"
click node_apmpi "https://github.com/darshan-hpc/darshan/blob/main/autoperf/apmpi/lib/darshan-apmpi.c"
click node_apss "https://github.com/darshan-hpc/darshan/blob/main/autoperf/apss/lib/darshan-apss.c"
click node_dxt_heatmap "https://github.com/darshan-hpc/darshan/tree/main/darshan-runtime/lib"
click node_log_format "https://github.com/darshan-hpc/darshan/blob/main/include/darshan-log-format.h"
click node_logutils "https://github.com/darshan-hpc/darshan/blob/main/darshan-util/darshan-logutils.c"
click node_parser "https://github.com/darshan-hpc/darshan/blob/main/darshan-util/darshan-parser.c"
click node_cffi "https://github.com/darshan-hpc/darshan/blob/main/darshan-util/pydarshan/darshan/backend/cffi_backend.py"
click node_report "https://github.com/darshan-hpc/darshan/blob/main/darshan-util/pydarshan/darshan/report.py"
click node_summary "https://github.com/darshan-hpc/darshan/blob/main/darshan-util/pydarshan/darshan/cli/summary.py"
click node_plots "https://github.com/darshan-hpc/darshan/tree/main/darshan-util/pydarshan/darshan/experimental/plots"

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_core,node_runtime_api toneBlue
class node_posix,node_mpiio,node_apmpi,node_apss,node_dxt_heatmap,node_logfile toneAmber
class node_log_format,node_logutils,node_parser toneMint
class node_cffi,node_report,node_summary,node_plots toneRose
class node_application,node_analyst toneIndigo
```

## Components

### Runtime capture

- [Runtime core](https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan-core.c): `darshan-runtime/lib/darshan-core.c`
- [Runtime interfaces](https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan.h): `darshan-runtime/lib/darshan.h`

### Instrumentation modules

- [POSIX I/O](https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan-posix.c): `darshan-runtime/lib/darshan-posix.c`
- [MPI-IO](https://github.com/darshan-hpc/darshan/blob/main/darshan-runtime/lib/darshan-mpiio.c): `darshan-runtime/lib/darshan-mpiio.c`
- [MPI profiling](https://github.com/darshan-hpc/darshan/blob/main/autoperf/apmpi/lib/darshan-apmpi.c): `autoperf/apmpi/lib/darshan-apmpi.c`
- [System counters](https://github.com/darshan-hpc/darshan/blob/main/autoperf/apss/lib/darshan-apss.c): `autoperf/apss/lib/darshan-apss.c`
- [Tracing and heatmaps](https://github.com/darshan-hpc/darshan/tree/main/darshan-runtime/lib): `darshan-runtime/lib`

### Log utilities

- [Log format](https://github.com/darshan-hpc/darshan/blob/main/include/darshan-log-format.h): `include/darshan-log-format.h`
- [Log access](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/darshan-logutils.c): `darshan-util/darshan-logutils.c`
- [Text parser](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/darshan-parser.c): `darshan-util/darshan-parser.c`

### Python analysis

- [Python backend](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/pydarshan/darshan/backend/cffi_backend.py): `darshan-util/pydarshan/darshan/backend/cffi_backend.py`
- [Darshan report](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/pydarshan/darshan/report.py): `darshan-util/pydarshan/darshan/report.py`
- [Summary CLI](https://github.com/darshan-hpc/darshan/blob/main/darshan-util/pydarshan/darshan/cli/summary.py): `darshan-util/pydarshan/darshan/cli/summary.py`
- [Analysis plots](https://github.com/darshan-hpc/darshan/tree/main/darshan-util/pydarshan/darshan/experimental/plots): `darshan-util/pydarshan/darshan/experimental/plots`

### Other components

- **HPC application**
- **Darshan log**
- **Analyst**

## Connections

- HPC application → Runtime core: runs under
- Runtime core → Runtime interfaces: uses interfaces (evidence: `darshan-runtime/lib/darshan.h`)
- Runtime core → POSIX I/O: dispatches modules
- Runtime core → MPI-IO: dispatches modules
- Runtime core → MPI profiling: dispatches modules
- Runtime core → System counters: dispatches modules
- MPI-IO → Tracing and heatmaps: records tracing (evidence: `darshan-runtime/lib/darshan-mpiio.c`)
- Runtime core → Darshan log: writes measurements
- Darshan log → Log access: opens for analysis
- Log access → Log format: uses format
- Text parser → Log access: reads log data (evidence: `darshan-util/darshan-parser.c`)
- Darshan log → Text parser: is parsed by
- Darshan log → Python backend: opens log (evidence: `darshan-util/pydarshan/darshan/backend/cffi_backend.py`)
- Python backend → Darshan report: provides records (evidence: `darshan-util/pydarshan/darshan/report.py`)
- Darshan report → Summary CLI: feeds summary (evidence: `darshan-util/pydarshan/darshan/cli/summary.py`)
- Summary CLI → Analysis plots: uses plotting (evidence: `darshan-util/pydarshan/darshan/cli/summary.py`)
- Analyst → Text parser: inspects logs
- Analyst → Summary CLI: generates reports
