Config-driven application pipeline¶
This page describes how a JSON or TOML file becomes a running 0.2 simulation.
Shipped tungsten and aluminumNew binaries are instances of the one generic
pfc::ui::SpectralETDSession<Physics, Stack>
(json_spectral_etd_session.hpp). Other drivers use
pfc::ui::make_simulation_session<Stack> and pfc::sim::run. Headers live
under include/openpfc/frontend/ui/ (simulation_wiring_conditions.hpp,
simulation_wiring_writers.hpp, json_checkpoint.hpp).
The 0.1 pfc::ui::App<Model> / Simulator path is gone. See
MIGRATION_0.1_to_0.2.md.
For install and MPI setup, see INSTALL.md. For shared
config vocabulary, see configuration.md.
Big picture¶
flowchart LR
subgraph load [Load]
A[config.json / .toml]
end
subgraph stack [Stack]
W[Domain]
D[Decomposition]
F[FFT]
T[Time]
end
subgraph session [Session]
ST[SimulationState]
P[Physics / ETD]
end
subgraph wire [JSON wiring]
RW[Results writers]
IC[Initial conditions]
BC[Boundary conditions]
CK[CheckpointService]
end
A --> W --> D --> F --> T
F --> ST
T --> P
ST --> P
A --> wire
wire --> session
session --> Driver["pfc::sim::run"]
make_simulation_session<SpectralCPUStack>reads domain, time,method/backend, andplan_options(FFT) and constructspfc::sim::stacks::SpectralCPUStack. CPU plan options live inspectral_fft_stack_factory.hpp.make_simulation_session<GPUSpectralStack<CUDASpace/HIPSpace>>overlays the same JSONplan_optionskeys onto cuFFT / rocFFT defaults.SpectralETDSessionon aGPUSpectralStackuses the same overlay. GPU-aware MPI, pencils, and reshape algorithm apply to multi-rank device FFTs.ICs, BCs, and writers are parsed from the
FieldModifierandResultsWritercatalogs (parse_initial_conditions_from_json,parse_boundary_conditions_from_json,parse_result_writers_from_json).SpectralETDSessionapplies ICs once throughpfc::apply_field_modifier(host or deviceField), BCs in thepfc::sim::runapply hook, and writers onon_save; a modifier withouttargetacts on the physics’ primary field.pfc::ui::make_checkpoint_service+CheckpointService::restore_from_config/maybe_saveown restart.restart_fromcannot mix withsimulator.increment/simulator.result_counter.
Driver order of operations¶
pfc::ui::SpectralETDSession<Physics, Stack> (tungsten, aluminum):
Step |
What happens |
|---|---|
1 |
Load settings from |
2 |
|
3 |
|
4 |
|
5 |
Parse catalog BCs; configure writers from field geometry; |
6 |
|
Custom drivers can parse subsets with parse_result_writers_from_json,
parse_initial_conditions_from_json, parse_boundary_conditions_from_json,
and apply_simulator_section_from_json(time, settings). Pass
JsonWiringContext{comm, mpi_rank, rank0} and explicit catalogs
(default_field_modifier_catalog(), default_results_writer_catalog()).
JsonWiringSession bundles context with both catalogs for
parse_runtime_from_json(time, settings, session).
JSON sections consumed by the default spectral path¶
Exact keys vary slightly by app and schema version; always treat
apps/tungsten/inputs_json/ as ground truth. Typical top-level usage:
Section / keys |
Handled by |
Role |
|---|---|---|
|
|
Grid and physical extent. |
|
|
Integration interval and output cadence. |
|
HeFFTe |
FFT backend ( |
|
App-local physics params |
Physics coefficients. |
|
|
If |
|
|
Each entry has |
|
|
Same pattern: |
|
|
Optional |
|
|
Periodic save and restore of |