Expand description
Parallel solver orchestration for multi-stage physics pipelines.
This module provides a dependency-aware scheduler that organizes solver stages into parallel waves via topological sorting. Stages within the same wave have no mutual dependencies and can conceptually execute in parallel, while stages in later waves depend on earlier ones.
§Architecture
The orchestrator works in three phases:
- Registration - stages and their dependencies are added via
ParallelOrchestrator::add_stage. - Scheduling -
ParallelOrchestrator::compute_scheduleperforms a topological sort to group independent stages into waves (Kahn’s algorithm with cycle detection). - Execution -
ParallelOrchestrator::executeruns each wave sequentially, executing stages within each wave. Per-stage wall-clock timings are accumulated.
§Future: rayon-based parallelism
Currently stages within a wave run sequentially. When rayon is added as a
workspace dependency, intra-wave parallelism can be enabled behind a feature
flag (e.g. parallel-rayon) by replacing the sequential loop with
rayon::scope or rayon::join.
Structs§
- Parallel
Orchestrator - Orchestrates the execution of multiple solver stages respecting dependencies.
- Pipeline
Schedule - A computed execution schedule produced by topological sorting.
- Stage
Dependency - Describes ordering constraints for a single stage.
Enums§
- Orchestrator
Error - Errors that can occur during orchestration scheduling or execution.
Traits§
- Solver
Stage - A single stage in a physics solver pipeline.
Functions§
- topological_
sort - Performs a topological sort of
nstages using Kahn’s algorithm.