pub struct Schedule { /* private fields */ }Expand description
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn makespan(&self) -> Millis
pub fn makespan(&self) -> Millis
When the last unit finished.
Zero for an empty graph. This is an estimate, not a bound: see lower_bound for the
numbers that hold whatever the scheduler does.
Examples found in repository?
examples/scaling.rs (line 105)
78fn main() -> Result<(), Box<dyn Error>> {
79 let executors = NonZeroU32::new(16).ok_or("16 is not zero")?;
80 println!(
81 "{:>7} {:>8} {:>10} {:>10} {:>10}",
82 "units", "edges", "construct", "analyse", "simulate"
83 );
84 for &(units, fan_in) in &[(1_000, 4), (5_000, 4), (20_000, 6), (50_000, 6)] {
85 let start = Instant::now();
86 let graph = build(units, fan_in)?;
87 let constructed = start.elapsed();
88
89 let start = Instant::now();
90 let analysis = analyze(&graph);
91 let analysed = start.elapsed();
92
93 let start = Instant::now();
94 let schedule = simulate(&graph, executors, Policy::CargoLike);
95 let simulated = start.elapsed();
96
97 println!(
98 "{:>7} {:>8} {:>10.1?} {:>10.1?} {:>10.1?} critical path {}, makespan {}",
99 units,
100 graph.edge_count(),
101 constructed,
102 analysed,
103 simulated,
104 analysis.critical_path_len(),
105 schedule.makespan(),
106 );
107 }
108 Ok(())
109}Sourcepub fn start(&self, id: UnitId) -> Option<Millis>
pub fn start(&self, id: UnitId) -> Option<Millis>
When a unit started, or None if the index is outside this schedule.
Sourcepub fn finish(&self, id: UnitId) -> Option<Millis>
pub fn finish(&self, id: UnitId) -> Option<Millis>
When a unit finished, or None if the index is outside this schedule.
Always its start plus its whole duration: a unit is never preempted or migrated.
Sourcepub fn executors(&self) -> NonZeroU32
pub fn executors(&self) -> NonZeroU32
The executor count this schedule was produced for.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
impl UnwindSafe for Schedule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more