gflow 0.4.15

A lightweight, single-node job scheduler written in Rust.
Documentation
use serde::{Deserialize, Serialize};

use super::gpu_allocation::GpuAllocationStrategy;

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IgnoredGpuProcess {
    pub gpu_index: u32,
    pub pid: u32,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpuInfo {
    pub uuid: String,
    pub index: u32,
    pub available: bool,
    /// Reason why GPU is unavailable (e.g., occupied by non-gflow process)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchedulerInfo {
    pub gpus: Vec<GpuInfo>,
    /// GPU indices that scheduler is configured to use (None = all GPUs)
    pub allowed_gpu_indices: Option<Vec<u32>>,
    /// Strategy used when allocating GPUs for new jobs.
    pub gpu_allocation_strategy: GpuAllocationStrategy,
}