def region_ns

stelliferous@0.0.2.0 · kernel_cost.bend:15

import stelliferous@0.0.2.0/kernel_cost.bend as KernelCost
import Base

15# The official runtime grows fork tasks and queues fork-free tasks for its
16# work round (monk_step, row_grow, cube_run). No fixed number of leaves can
17# be subtracted as already completed by growth. Price complete waves of at
18# most workers leaves, using the largest path (including clones) per wave.
19# This is a conservative scheduling estimate, not a bound on the runtime's
20# static ring distribution. Callers charge the two wake rounds separately.
21def region_ns(+workers: U32,+leaves: U32,+span: F32) -> F32:
22  +pool = U32.max(workers,1)
23  +waves = (leaves / pool + Bool.pick(U32,U32.is_zero((leaves % pool : U32)),0,1) : U32)
24  (span * U32.to_f32(waves) : F32)

Uses (10)

Used by (3)