code wiki / _hdl_build / nx_nomad_schedule.nx
nx_nomad_schedule.nx
buildroot/runtime/_hdl_build/nx_nomad_schedule.nx
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
imports: nx_syscalls.nx
imported by: nx_nomad_schedule_test.nx
structs
| none |
consts
| 9 | const NOMAD_UNPLACEABLE: i64 = 0 - 1 |
functions
| 12 | func ns_feasible(fcpu: *i64, fmem: *i64, i: i64, cpu: i64, mem: i64) -> i64 called by 1: ns_place |
| 18 | func ns_leftover(fcpu: *i64, fmem: *i64, i: i64, cpu: i64, mem: i64) -> i64 called by 1: ns_place |
| 24 | func ns_place(fcpu: *i64, fmem: *i64, n: i64, cpu: i64, mem: i64) -> i64 |
| 40 | func ns_alloc(fcpu: *i64, fmem: *i64, n: i64, cpu: i64, mem: i64) -> i64 |