code wiki / _hdl_build / nx_parallel_run.nx
nx_parallel_run.nx
buildroot/runtime/_hdl_build/nx_parallel_run.nx
about
nx_parallel_run.nx -- the PARALLEL EXECUTION engine (operator: go fast + in parallel,
32-min sequential beat is a Camry). Runs a LIST of INDEPENDENT organs K-wide
concurrently (K from nx_resources -- schedule to the iron), instead of one-at-a-time.
The JazzNet move on our OWN beat: 20 cores, 16 lanes, ~16x the throughput on the
parallelizable graders. Wave-based: launch K, wait the batch, launch the next K.
SAFE for INDEPENDENT steps only (read different logs / write different outputs) --
the dependent chain (attempt->reconcile->ark) stays sequential elsewhere.
in: a conf of organ names (one per line, # comments); K from resources.log.
Durable: PARALLEL row (lanes, count, wall-ms) -> knowledge/status/parallel.log.
Exit = number of nonzero organs. argv[1]=conf argv[2]=k-override. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const K_MAGIC_1000000: i64 = 1000000 |
| 13 | const K_MAGIC_65536: i64 = 65536 |
| 14 | const K_MAGIC_65520: i64 = 65520 |
functions
| 15 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | func _fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 17 | func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 18 | func pr_ms() -> i64 |
| 23 | func pr_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 32 | func pr_klanes() -> i64 |
| 51 | func pr_launch(name: *u8, core: i64) -> i64 |
| 71 | func main(argc: i64, argv: *i64) -> i64 |