code wiki / _hdl_build / nx_nomad_schedule.nx

nx_nomad_schedule.nx

buildroot/runtime/_hdl_build/nx_nomad_schedule.nx

2173 B46 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_nomad_schedule.nx -- sovereign CLUSTER SCHEDULER core (HashiCorp Nomad-class; NOMAD-001, new frontier). Place a job (cpu+mem request) onto the BEST-FIT node via BIN-PACKING: among nodes that have enough free cpu AND mem (feasibility), pick the one with the LEAST leftover (tightest fit) so the cluster packs dense and leaves the largest contiguous holes for big jobs. Placing decrements that node's free capacity. A job that fits NOWHERE is REJECTED (no overcommit -- the safety property). Pure logic over node arrays; this is the allocator the rest of Nomad (eval queue, reschedule-on-failure, constraints) builds on. ORIGINAL.

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_nomad_schedule.nx nx_nomad_schedule_test.nx

imports: nx_syscalls.nx

imported by: nx_nomad_schedule_test.nx

structs

none

consts

9const NOMAD_UNPLACEABLE: i64 = 0 - 1

functions

12func ns_feasible(fcpu: *i64, fmem: *i64, i: i64, cpu: i64, mem: i64) -> i64
called by 1: ns_place
18func ns_leftover(fcpu: *i64, fmem: *i64, i: i64, cpu: i64, mem: i64) -> i64
called by 1: ns_place
24func ns_place(fcpu: *i64, fmem: *i64, n: i64, cpu: i64, mem: i64) -> i64
called by 2: ns_allocmain calls 2: ns_feasiblens_leftover
40func ns_alloc(fcpu: *i64, fmem: *i64, n: i64, cpu: i64, mem: i64) -> i64
called by 1: main calls 1: ns_place