# jairomcarmona/siestaflow architecture

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

- Interactive diagram: https://gitdiagram.com/jairomcarmona/siestaflow
- Repository: https://github.com/jairomcarmona/siestaflow

## Overview

#### Purpose and entry points
SIESTAFLOW is a Python 0.2 alpha orchestrator for declarative SIESTA DFT campaigns executed inside persistent SLURM allocations. It prepares portable, hash-verified controller packages locally; users manually transfer and submit them. Primary CLI entry points are `src/siestaflow/cli.py` and `src/siestaflow/__main__.py`; package metadata is in `pyproject.toml`.

#### Project and campaign specification
Project examples define systems, structures, pseudopotentials, resource profiles, policies, authorizations, expected contracts, and campaign matrices. These are data boundaries: scientific choices remain project-owned rather than core-owned.
- `src/siestaflow/project.py`
- `src/siestaflow/campaign.py`
- `examples/generic/minimal_siesta_smoke/project.yaml`

#### Authorization and gate-controlled planning
Before execution, authorization and gate records constrain which campaign phases may proceed. Campaigns can form dependency DAGs, with gates representing explicit scientific or operational acceptance points rather than implicit controller decisions.
- `src/siestaflow/authorization.py`
- `src/siestaflow/gates.py`
- `src/siestaflow/siesta_campaigns.py`

#### SIESTA engine boundary
The SIESTA adapter validates and renders FDF inputs, produces engine commands and required artifacts, resolves pseudopotentials, and parses output into structured result models. The supported FDF registry isolates engine-version-specific vocabulary.
- `src/siestaflow/engines/siesta/adapter.py`
- `src/siestaflow/engines/siesta/fdf_renderer.py`
- `src/siestaflow/engines/siesta/output_parser.py`

#### Local preparation and immutable package boundary
Local commands validate project inputs and assemble self-contained remote/controller packages with manifests, checksums, embedded runtime code, inputs, and artifacts. This boundary deliberately stops before remote transfer/submission; package integrity enables manual transport and reproducible remote execution.
- `src/siestaflow/project_packages.py`
- `src/siestaflow/controller_package.py`
- `src/siestaflow/m4_remote_package.py`

#### Allocation-local execution controller
Once submitted, the packaged controller runs within one SLURM allocation. It manages phase dependencies, resource placement, concurrent waves, launch selection, controlled shutdown, recovery/resubmission, and durable progress state. Launch backends support `srun`, direct execution, and Hydra (`mpiexec.hydra -bootstrap ssh`).
- `src/siestaflow/execution/allocation_controller.py`
- `src/siestaflow/execution/srun_launcher.py`
- `src/siestaflow/execution/hydra_launcher.py`

#### Scheduler and remote-environment integration
SLURM is the material infrastructure boundary: scheduler environment inspection, partition/account association resolution, allocation launch, and job-evidence collection are separated from core campaign semantics. Yoltla-specific profiles and remote probes encode observed cluster conditions.
- `src/siestaflow/execution/slurm_environment.py`
- `src/siestaflow/validation/scheduler_resolution.py`
- `config/cluster_profiles/yoltla_siesta.yaml`

#### Runtime evidence and operational packages
The repository includes deployable remote validation packages for environment probing, real SIESTA smoke runs, single-allocation execution, and staged MnO₂ campaigns. They carry SLURM scripts, manifests, pseudopotentials, and minimized embedded runtime copies; these are acceptance artifacts alongside the installable `src` package.
- `remote_validation/M4_SURF_GR5X5_SINGLE_ALLOCATION_REMOTE_SMOKE/campaign.slurm`
- `remote_validation/M4_SURF_GR5X5_SINGLE_ALLOCATION_REMOTE_SMOKE/runtime/siestaflow/execution/allocation_controller.py`
- `remote_validation/YOLTLA_M1_MNO2_STAGED_CAMPAIGN_V2/campaign_graph.json`

Main entry points: [`src/siestaflow/execution/allocation_controller.py`](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/execution/allocation_controller.py) (Allocation controller), [`src/siestaflow/siesta_campaigns.py`](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/siesta_campaigns.py) (SIESTA campaign DAG), [`src/siestaflow/project_packages.py`](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/project_packages.py) (Project package builder), [`src/siestaflow/project.py`](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/project.py) (Project definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_spec["Project specification"]
  node_project_spec["Project definitions<br/>project model<br/>[project.py]"]
  node_campaign_spec["Campaign matrix<br/>campaign model<br/>[campaign.py]"]
  node_example_project["Example project YAML<br/>project data<br/>[project.yaml]"]
end

subgraph group_planning["Planning controls"]
  node_authorization["Authorizations<br/>policy control<br/>[authorization.py]"]
  node_gates["Acceptance gates<br/>phase control<br/>[gates.py]"]
  node_siesta_campaigns["SIESTA campaign DAG<br/>campaign planner"]
  node_siesta_adapter["SIESTA adapter<br/>engine boundary<br/>[adapter.py]"]
  node_fdf_renderer["FDF renderer<br/>input renderer<br/>[fdf_renderer.py]"]
end

subgraph group_packaging["Local packaging"]
  node_cli["CLI entry points<br/>Python CLI<br/>[cli.py]"]
  node_module_entry["Module entry point<br/>Python entry<br/>[__main__.py]"]
  node_project_packages["Project package builder<br/>local validator"]
  node_controller_package["Controller package<br/>immutable package"]
  node_remote_package["M4 remote package<br/>package assembly"]
end

subgraph group_remote["Allocation execution"]
  node_output_parser["SIESTA output parser<br/>result parser<br/>[output_parser.py]"]
  node_allocation_controller["Allocation controller<br/>remote orchestrator"]
  node_launchers["Launch backends<br/>execution launchers<br/>[srun_launcher.py]"]
end

subgraph group_ops["Infrastructure evidence"]
  node_slurm_environment{{"SLURM environment<br/>scheduler integration"}}
  node_scheduler_resolution["Scheduler resolution<br/>resource resolver"]
  node_cluster_profile["Yoltla profile<br/>cluster profile<br/>[yoltla_siesta.yaml]"]
  node_remote_validation["Remote validation packages<br/>acceptance artifacts<br/>[campaign.slurm]"]
end

node_module_entry -->|"invokes"| node_cli
node_example_project -->|"instantiates"| node_project_spec
node_project_spec -->|"defines inputs for"| node_campaign_spec
node_campaign_spec -->|"expands into"| node_siesta_campaigns
node_authorization -->|"constrains"| node_siesta_campaigns
node_gates -->|"authorizes phases"| node_siesta_campaigns
node_siesta_campaigns -->|"uses"| node_siesta_adapter
node_siesta_adapter -->|"renders inputs with"| node_fdf_renderer
node_cli -->|"prepares locally"| node_project_packages
node_project_spec -->|"validated by"| node_project_packages
node_siesta_campaigns -->|"packages plan"| node_project_packages
node_siesta_adapter -->|"supplies inputs and artifacts"| node_project_packages
node_project_packages -->|"builds"| node_controller_package
node_remote_package -->|"assembles"| node_controller_package
node_controller_package -.->|"manually transferred and run"| node_allocation_controller
node_allocation_controller -->|"selects"| node_launchers
node_allocation_controller -->|"parses completed runs"| node_output_parser
node_allocation_controller -->|"runs within"| node_slurm_environment
node_scheduler_resolution -->|"resolves resources for"| node_slurm_environment
node_cluster_profile -->|"configures"| node_scheduler_resolution
node_remote_validation -.->|"embeds and exercises"| node_allocation_controller
node_remote_validation -.->|"captures acceptance evidence"| node_slurm_environment

click node_cli "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/cli.py"
click node_module_entry "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/__main__.py"
click node_project_spec "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/project.py"
click node_campaign_spec "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/campaign.py"
click node_example_project "https://github.com/jairomcarmona/siestaflow/blob/main/examples/generic/minimal_siesta_smoke/project.yaml"
click node_authorization "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/authorization.py"
click node_gates "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/gates.py"
click node_siesta_campaigns "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/siesta_campaigns.py"
click node_siesta_adapter "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/engines/siesta/adapter.py"
click node_fdf_renderer "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/engines/siesta/fdf_renderer.py"
click node_output_parser "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/engines/siesta/output_parser.py"
click node_project_packages "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/project_packages.py"
click node_controller_package "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/controller_package.py"
click node_remote_package "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/m4_remote_package.py"
click node_allocation_controller "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/execution/allocation_controller.py"
click node_launchers "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/execution/srun_launcher.py"
click node_slurm_environment "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/execution/slurm_environment.py"
click node_scheduler_resolution "https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/validation/scheduler_resolution.py"
click node_cluster_profile "https://github.com/jairomcarmona/siestaflow/blob/main/config/cluster_profiles/yoltla_siesta.yaml"
click node_remote_validation "https://github.com/jairomcarmona/siestaflow/blob/main/remote_validation/M4_SURF_GR5X5_SINGLE_ALLOCATION_REMOTE_SMOKE/campaign.slurm"

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_project_spec,node_campaign_spec,node_example_project toneBlue
class node_authorization,node_gates,node_siesta_campaigns,node_siesta_adapter,node_fdf_renderer toneAmber
class node_cli,node_module_entry,node_project_packages,node_controller_package,node_remote_package toneMint
class node_output_parser,node_allocation_controller,node_launchers toneRose
class node_slurm_environment,node_scheduler_resolution,node_cluster_profile,node_remote_validation toneIndigo
```

## Components

### Project specification

Scientific choices and campaign intent remain project-owned.

- [Project definitions](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/project.py): project model · `src/siestaflow/project.py`
- [Campaign matrix](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/campaign.py): campaign model · `src/siestaflow/campaign.py`
- [Example project YAML](https://github.com/jairomcarmona/siestaflow/blob/main/examples/generic/minimal_siesta_smoke/project.yaml): project data · `examples/generic/minimal_siesta_smoke/project.yaml`

### Planning controls

Authorization and explicit gates constrain campaign progression.

- [Authorizations](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/authorization.py): policy control · `src/siestaflow/authorization.py`
- [Acceptance gates](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/gates.py): phase control · `src/siestaflow/gates.py`
- [SIESTA campaign DAG](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/siesta_campaigns.py): campaign planner · Builds dependency-aware campaign phases. · `src/siestaflow/siesta_campaigns.py`
- [SIESTA adapter](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/engines/siesta/adapter.py): engine boundary · Validates inputs, resolves artifacts, and creates engine commands. · `src/siestaflow/engines/siesta/adapter.py`
- [FDF renderer](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/engines/siesta/fdf_renderer.py): input renderer · `src/siestaflow/engines/siesta/fdf_renderer.py`

### Local packaging

Local preparation ends at an immutable package for manual transport.

- [CLI entry points](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/cli.py): Python CLI · `src/siestaflow/cli.py`
- [Module entry point](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/__main__.py): Python entry · `src/siestaflow/__main__.py`
- [Project package builder](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/project_packages.py): local validator · Validates project inputs and assembles portable package contents. · `src/siestaflow/project_packages.py`
- [Controller package](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/controller_package.py): immutable package · Contains manifests, checksums, runtime, inputs, and artifacts. · `src/siestaflow/controller_package.py`
- [M4 remote package](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/m4_remote_package.py): package assembly · `src/siestaflow/m4_remote_package.py`

### Allocation execution

Packaged runtime orchestrates work inside one SLURM allocation.

- [SIESTA output parser](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/engines/siesta/output_parser.py): result parser · `src/siestaflow/engines/siesta/output_parser.py`
- [Allocation controller](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/execution/allocation_controller.py): remote orchestrator · Schedules dependency waves, placement, recovery, and durable progress. · `src/siestaflow/execution/allocation_controller.py`
- [Launch backends](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/execution/srun_launcher.py): execution launchers · Supports srun and Hydra launches. · `src/siestaflow/execution/srun_launcher.py`

### Infrastructure evidence

Scheduler integration and deployable validation artifacts.

- [SLURM environment](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/execution/slurm_environment.py): scheduler integration · Inspects allocation environment and gathers job evidence. · `src/siestaflow/execution/slurm_environment.py`
- [Scheduler resolution](https://github.com/jairomcarmona/siestaflow/blob/main/src/siestaflow/validation/scheduler_resolution.py): resource resolver · Resolves partition and account associations. · `src/siestaflow/validation/scheduler_resolution.py`
- [Yoltla profile](https://github.com/jairomcarmona/siestaflow/blob/main/config/cluster_profiles/yoltla_siesta.yaml): cluster profile · `config/cluster_profiles/yoltla_siesta.yaml`
- [Remote validation packages](https://github.com/jairomcarmona/siestaflow/blob/main/remote_validation/M4_SURF_GR5X5_SINGLE_ALLOCATION_REMOTE_SMOKE/campaign.slurm): acceptance artifacts · Deployable smoke and staged-campaign evidence packages. · `remote_validation/M4_SURF_GR5X5_SINGLE_ALLOCATION_REMOTE_SMOKE/campaign.slurm`

## Connections

- Module entry point → CLI entry points: invokes
- Example project YAML → Project definitions: instantiates
- Project definitions → Campaign matrix: defines inputs for
- Campaign matrix → SIESTA campaign DAG: expands into
- Authorizations → SIESTA campaign DAG: constrains
- Acceptance gates → SIESTA campaign DAG: authorizes phases
- SIESTA campaign DAG → SIESTA adapter: uses
- SIESTA adapter → FDF renderer: renders inputs with
- CLI entry points → Project package builder: prepares locally
- Project definitions → Project package builder: validated by
- SIESTA campaign DAG → Project package builder: packages plan
- SIESTA adapter → Project package builder: supplies inputs and artifacts
- Project package builder → Controller package: builds
- M4 remote package → Controller package: assembles
- Controller package → Allocation controller: manually transferred and run
- Allocation controller → Launch backends: selects
- Allocation controller → SIESTA output parser: parses completed runs
- Allocation controller → SLURM environment: runs within
- Scheduler resolution → SLURM environment: resolves resources for
- Yoltla profile → Scheduler resolution: configures
- Remote validation packages → Allocation controller: embeds and exercises
- Remote validation packages → SLURM environment: captures acceptance evidence
