Module debug

Module debug 

Source
Expand description

Debug helpers for serializing/deserializing runtime plans.

use daedalus_runtime::{debug, RuntimePlan, RuntimeSegment, RuntimeNode, EdgePolicyKind};
use daedalus_planner::ComputeAffinity;

let plan = RuntimePlan {
    default_policy: EdgePolicyKind::Fifo,
    backpressure: daedalus_runtime::BackpressureStrategy::None,
    lockfree_queues: false,
    graph_metadata: Default::default(),
    nodes: vec![
        RuntimeNode {
            id: "a".into(),
            bundle: None,
            label: None,
            compute: ComputeAffinity::CpuOnly,
            const_inputs: vec![],
            sync_groups: vec![],
            metadata: Default::default(),
        }
    ],
    edges: vec![],
    gpu_edges: vec![],
    gpu_entries: vec![],
    gpu_exits: vec![],
    segments: vec![RuntimeSegment { nodes: vec![], compute: ComputeAffinity::CpuOnly }],
    schedule_order: vec![],
    gpu_segments: vec![],
};
let json = debug::to_pretty_json(&plan);
let round = debug::from_json(&json).unwrap();
assert_eq!(plan.nodes.len(), round.nodes.len());

Functionsยง

from_json
Deserialize a runtime plan from JSON.
to_json
Serialize a runtime plan to compact JSON.
to_pretty_json
Serialize a runtime plan to pretty-printed JSON.