Skip to main content

Schedule

Struct Schedule 

Source
pub struct Schedule { /* private fields */ }
Expand description

When every unit ran, on a fixed number of executors under a fixed policy.

Produced by simulate. An identifier from a different graph is not detected; see Analysis.

Implementations§

Source§

impl Schedule

Source

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}
Source

pub fn start(&self, id: UnitId) -> Option<Millis>

When a unit started, or None if the index is outside this schedule.

Source

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.

Source

pub fn policy(&self) -> Policy

The policy this schedule was produced under.

Source

pub fn executors(&self) -> NonZeroU32

The executor count this schedule was produced for.

Trait Implementations§

Source§

impl Clone for Schedule

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Schedule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.