pub struct Schedule { /* private fields */ }Expand description
A wavefront schedule: the full level decomposition of a ComputeGraph
plus derived concurrency metrics.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn levelize(graph: &ComputeGraph) -> GraphResult<Self>
pub fn levelize(graph: &ComputeGraph) -> GraphResult<Self>
Computes the wavefront decomposition of graph.
Each node’s level is its longest-path distance (in edges) from any source node; nodes sharing a level form one wavefront. The critical path cost is the cost-weighted longest source→sink path.
§Errors
Returns GraphError::EmptyGraph if the graph has no nodes.
Sourcepub fn wavefronts(&self) -> &[Wavefront]
pub fn wavefronts(&self) -> &[Wavefront]
Returns the wavefronts in execution order.
Sourcepub fn level_of(&self, id: NodeId) -> GraphResult<usize>
pub fn level_of(&self, id: NodeId) -> GraphResult<usize>
Sourcepub fn max_width(&self) -> usize
pub fn max_width(&self) -> usize
Returns the maximum instantaneous parallelism (widest wavefront).
Sourcepub fn critical_path_cost(&self) -> u64
pub fn critical_path_cost(&self) -> u64
Returns the cost-weighted critical path length — the makespan achievable with unbounded concurrency.
Sourcepub fn bounded_makespan(&self, max_streams: usize) -> u64
pub fn bounded_makespan(&self, max_streams: usize) -> u64
Estimates the makespan when each wavefront is executed with at most
max_streams concurrent nodes.
Within a wave, nodes are greedily packed onto max_streams lanes by
longest-cost-first (LPT list scheduling); the wave’s duration is the
most-loaded lane, and the schedule’s makespan is the sum over waves.
With max_streams == 0 it is treated as 1 (fully sequential per
wave). With max_streams >= max_width() the result equals the sum of
each wave’s max_cost.
This is a model, not a device measurement: it gives an upper bound on achievable speedup from stream parallelism without launching anything.
Sourcepub fn unbounded_makespan(&self) -> u64
pub fn unbounded_makespan(&self) -> u64
Returns the makespan under unbounded streams: the sum of each wave’s
max_cost. This is a lower bound that the critical-path cost refines.