Skip to main content

gwr_models/processing_element/
dispatch.rs

1// Copyright (c) 2026 Graphcore Ltd. All rights reserved.
2
3use async_trait::async_trait;
4use gwr_engine::types::{SimError, SimResult};
5
6use crate::processing_element::task::Task;
7
8#[async_trait(?Send)]
9pub trait Dispatch {
10    fn task_by_id(&self, task_idx: usize) -> Result<Task, SimError>;
11    fn set_task_active(&self, task_idx: usize) -> SimResult;
12    fn set_task_completed(&self, task_idx: usize) -> SimResult;
13    fn ready_task_indices(&self, pe_name: &str) -> Result<(bool, Vec<usize>), SimError>;
14    async fn wait_for_change(&self);
15    fn total_tasks_for_pe(&self, pe_name: &str) -> usize;
16}