# extremeflow/neko architecture

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

- Interactive diagram: https://gitdiagram.com/extremeflow/neko
- Repository: https://github.com/extremeflow/neko

## Overview

Neko is a portable, high-order spectral-element framework for flow simulations. The documented user workflow is to provide a case (and optionally user code), then run Neko—often under MPI—to perform a simulation. The supplied tree emphasizes accelerator kernels and supporting parallel-I/O and physics modules; it does not expose the main Fortran runtime entry point or enough call sites to reconstruct a complete solver pipeline. The graph therefore includes documented capabilities and indexed kernel dependencies, while leaving unsampled wiring out.

Main entry points: [`src/math/bcknd/device/cuda/ax_helm_kernel.h`](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/ax_helm_kernel.h) (CUDA Helmholtz), [`src/math/bcknd/device/hip/ax_helm_kernel.h`](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/hip/ax_helm_kernel.h) (HIP Helmholtz), [`src/math/bcknd/device/cuda/dmma_tma_kernel.h`](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/dmma_tma_kernel.h) (CUDA TMA), [`src`](https://github.com/extremeflow/neko/tree/develop/src) (Neko runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_solver["Solver numerics"]
  node_runtime["Neko runtime"]
  node_sem["SEM coefficients<br/>[coef.c]"]
  node_math["Math operators<br/>[math.c]"]
end

subgraph group_physics["Flow extensions"]
  node_ale["Moving mesh<br/>[ale_kinematics.c]"]
  node_fluid["Compressible flow<br/>[compressible_res.c]"]
  node_les["LES models"]
  node_lpt["Particle tracking"]
  node_scalar["Scalar residuals<br/>[scalar_residual.c]"]
end

subgraph group_parallel["Parallel and I/O"]
  node_comm["Communication<br/>[comm_wrapper.c]"]
  node_adios["ADIOS2 streaming<br/>[nek_adios2.cpp]"]
end

subgraph group_compute["Accelerator compute"]
  node_axhelm_cuda["CUDA Helmholtz<br/>[ax_helm_kernel.h]"]
  node_dmma["CUDA DMMA<br/>[dmma_kernel.h]"]
  node_dmma_tma["CUDA TMA<br/>[dmma_tma_kernel.h]"]
  node_elem_cuda["CUDA element blocks<br/>[elem_block.h]"]
  node_axhelm_hip["HIP Helmholtz<br/>[ax_helm_kernel.h]"]
  node_elem_hip["HIP element blocks<br/>[elem_block.h]"]
  node_mfma["HIP MFMA<br/>[mfma_kernel.h]"]
end

node_user(("Simulation user"))
node_case["Case input"]

node_user -->|"provides case"| node_case
node_user -->|"runs"| node_runtime
node_case -->|"configures"| node_runtime
node_axhelm_cuda -->|"uses"| node_dmma
node_axhelm_cuda -->|"uses"| node_dmma_tma
node_axhelm_cuda -->|"uses"| node_elem_cuda
node_dmma_tma -->|"includes"| node_dmma
node_axhelm_hip -->|"uses"| node_elem_hip
node_axhelm_hip -->|"uses"| node_mfma

click node_runtime "https://github.com/extremeflow/neko/tree/develop/src"
click node_sem "https://github.com/extremeflow/neko/blob/develop/src/sem/bcknd/device/opencl/coef.c"
click node_math "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/opencl/math.c"
click node_axhelm_cuda "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/ax_helm_kernel.h"
click node_dmma "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/dmma_kernel.h"
click node_dmma_tma "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/dmma_tma_kernel.h"
click node_elem_cuda "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/elem_block.h"
click node_axhelm_hip "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/hip/ax_helm_kernel.h"
click node_elem_hip "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/hip/elem_block.h"
click node_mfma "https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/hip/mfma_kernel.h"
click node_ale "https://github.com/extremeflow/neko/blob/develop/src/ale/bcknd/device/opencl/ale_kinematics.c"
click node_fluid "https://github.com/extremeflow/neko/blob/develop/src/fluid/bcknd/device/opencl/compressible_res.c"
click node_les "https://github.com/extremeflow/neko/blob/develop/src/les/bcknd/device/opencl/dynamic_smagorinsky_nut.c"
click node_lpt "https://github.com/extremeflow/neko/blob/develop/src/lpt/bcknd/device/opencl/lpt_wall_collision.c"
click node_scalar "https://github.com/extremeflow/neko/blob/develop/src/scalar/bcknd/device/opencl/scalar_residual.c"
click node_comm "https://github.com/extremeflow/neko/blob/develop/src/comm/comm_wrapper.c"
click node_adios "https://github.com/extremeflow/neko/blob/develop/src/io/nek_adios2.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_runtime,node_sem,node_math,node_user toneBlue
class node_ale,node_fluid,node_les,node_lpt,node_scalar toneAmber
class node_comm,node_adios toneMint
class node_axhelm_cuda,node_dmma,node_dmma_tma,node_elem_cuda,node_axhelm_hip,node_elem_hip,node_mfma toneRose
class node_case toneIndigo
```

## Components

### Solver numerics

- [Neko runtime](https://github.com/extremeflow/neko/tree/develop/src): `src`
- [SEM coefficients](https://github.com/extremeflow/neko/blob/develop/src/sem/bcknd/device/opencl/coef.c): `src/sem/bcknd/device/opencl/coef.c`
- [Math operators](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/opencl/math.c): `src/math/bcknd/device/opencl/math.c`

### Flow extensions

- [Moving mesh](https://github.com/extremeflow/neko/blob/develop/src/ale/bcknd/device/opencl/ale_kinematics.c): `src/ale/bcknd/device/opencl/ale_kinematics.c`
- [Compressible flow](https://github.com/extremeflow/neko/blob/develop/src/fluid/bcknd/device/opencl/compressible_res.c): `src/fluid/bcknd/device/opencl/compressible_res.c`
- [LES models](https://github.com/extremeflow/neko/blob/develop/src/les/bcknd/device/opencl/dynamic_smagorinsky_nut.c): `src/les/bcknd/device/opencl/dynamic_smagorinsky_nut.c`
- [Particle tracking](https://github.com/extremeflow/neko/blob/develop/src/lpt/bcknd/device/opencl/lpt_wall_collision.c): `src/lpt/bcknd/device/opencl/lpt_wall_collision.c`
- [Scalar residuals](https://github.com/extremeflow/neko/blob/develop/src/scalar/bcknd/device/opencl/scalar_residual.c): `src/scalar/bcknd/device/opencl/scalar_residual.c`

### Parallel and I/O

- [Communication](https://github.com/extremeflow/neko/blob/develop/src/comm/comm_wrapper.c): `src/comm/comm_wrapper.c`
- [ADIOS2 streaming](https://github.com/extremeflow/neko/blob/develop/src/io/nek_adios2.cpp): `src/io/nek_adios2.cpp`

### Accelerator compute

- [CUDA Helmholtz](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/ax_helm_kernel.h): `src/math/bcknd/device/cuda/ax_helm_kernel.h`
- [CUDA DMMA](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/dmma_kernel.h): `src/math/bcknd/device/cuda/dmma_kernel.h`
- [CUDA TMA](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/dmma_tma_kernel.h): `src/math/bcknd/device/cuda/dmma_tma_kernel.h`
- [CUDA element blocks](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/cuda/elem_block.h): `src/math/bcknd/device/cuda/elem_block.h`
- [HIP Helmholtz](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/hip/ax_helm_kernel.h): `src/math/bcknd/device/hip/ax_helm_kernel.h`
- [HIP element blocks](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/hip/elem_block.h): `src/math/bcknd/device/hip/elem_block.h`
- [HIP MFMA](https://github.com/extremeflow/neko/blob/develop/src/math/bcknd/device/hip/mfma_kernel.h): `src/math/bcknd/device/hip/mfma_kernel.h`

### Other components

- **Simulation user**
- **Case input**

## Connections

- Simulation user → Case input: provides case (evidence: `README.md`)
- Simulation user → Neko runtime: runs (evidence: `README.md`)
- Case input → Neko runtime: configures (evidence: `README.md`)
- CUDA Helmholtz → CUDA DMMA: uses (evidence: `src/math/bcknd/device/cuda/ax_helm_kernel.h`)
- CUDA Helmholtz → CUDA TMA: uses (evidence: `src/math/bcknd/device/cuda/ax_helm_kernel.h`)
- CUDA Helmholtz → CUDA element blocks: uses (evidence: `src/math/bcknd/device/cuda/ax_helm_kernel.h`)
- CUDA TMA → CUDA DMMA: includes (evidence: `src/math/bcknd/device/cuda/dmma_tma_kernel.h`)
- HIP Helmholtz → HIP element blocks: uses (evidence: `src/math/bcknd/device/hip/ax_helm_kernel.h`)
- HIP Helmholtz → HIP MFMA: uses (evidence: `src/math/bcknd/device/hip/ax_helm_kernel.h`)
