code wiki / _hdl_build / nx_burst_scheduler.nx

nx_burst_scheduler.nx

buildroot/runtime/_hdl_build/nx_burst_scheduler.nx

8427 B121 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_burst_scheduler.nx -- This module schedules task bursts to local, LAN, or cloud resources based on available budget and SLA requirements.

dependencies 3 imports · 0 importers

nx_gate_gn.nx nx_gate_base.nx nx_syscalls.nx nx_burst_scheduler.nx

imports: nx_gate_gn.nxnx_gate_base.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gw sys_write sys_mmap plan_burst show_plan gw ↻ gn tier_name plan_uses_cloud gn ↻ sys_exit

structs

none

consts

18const TIER_MAGIC_50000: i64 = 50000
21const TIER_NAS: i64 = 0
22const TIER_LOCAL: i64 = 1 // this machine / workstation
23const TIER_OTHER: i64 = 2 // other LAN machines
24const TIER_CLOUD: i64 = 3 // cloud (elastic but costliest -- only when needed)
26const PLAN_NAS_ALONE: i64 = 0
27const PLAN_BURSTED: i64 = 1
28const PLAN_ESCALATE: i64 = 2

functions

30func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
calls 1: gw
32func tier_name(t: i64) -> *u8 { if t==TIER_NAS { return "NAS" as *u8 } if t==TIER_LOCAL { return "this-machine" as *u8 } if t==TIER_OTHER { return "other-LAN" as *u8 } return "CLOUD" as *u8 }
36func plan_burst(task_cost: i64, sla: i64, nb: *i64, nt: *i64, nn: i64, alloc: *i64) -> i64
55func plan_uses_cloud(nt: *i64, alloc: *i64, nn: i64) -> i64 { var i: i64=0; while i<nn { if alloc[i]>0 { if nt[i]==TIER_CLOUD { return 1 } } i=i+1 } return 0 }
57func show_plan(label: *u8, verdict: i64, task: i64, sla: i64, nb: *i64, nt: *i64, nn: i64, alloc: *i64) -> i64
66func main() -> i64