Skip to main content

Checkpointer

Trait Checkpointer 

Source
pub trait Checkpointer<S: GraphState>: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: Uuid,
        step: u64,
        state: &'life1 S,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load<'life0, 'async_trait>(
        &'life0 self,
        run_id: Uuid,
        step: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<S>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
        run_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn save_active<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: Uuid,
        step: u64,
        active: &'life1 [ActiveSnapshot],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn load_active<'life0, 'async_trait>(
        &'life0 self,
        run_id: Uuid,
        step: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveSnapshot>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for storing & retrieving graph state at superstep boundaries.

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, run_id: Uuid, step: u64, state: &'life1 S, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save state at step for run_id.

Source

fn load<'life0, 'async_trait>( &'life0 self, run_id: Uuid, step: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Option<S>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load state for run_id at step (or the latest if step is None).

Source

fn list<'life0, 'async_trait>( &'life0 self, run_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all saved step numbers for run_id.

Provided Methods§

Source

fn save_active<'life0, 'life1, 'async_trait>( &'life0 self, run_id: Uuid, step: u64, active: &'life1 [ActiveSnapshot], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save the engine’s active task snapshot alongside state. Default is no-op — older checkpointers won’t persist the active set, and engine::resume falls back to the start node when load_active returns empty.

Source

fn load_active<'life0, 'async_trait>( &'life0 self, run_id: Uuid, step: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveSnapshot>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load the active task snapshot for (run_id, step). Default is empty.

Implementors§