upxo.meshing.gbconformant.d3v2p1.parallel module

Deterministic work splitting and chunked execution on a backend plan.

upxo.meshing.gbconformant.d3v2p1.parallel.balanced_chunks(weights, n_chunks)[source]

Split item indices into n_chunks with similar total weight (largest first).

Deterministic: ties keep index order. Returns a list of index lists, empty chunks dropped.

upxo.meshing.gbconformant.d3v2p1.parallel.run_chunks(function, tasks, plan)[source]

function(task) for every task, in task order, on the plan’s tier (worker processes, or serially when the plan is ‘numpy’ or the pool fails; the plan records a fallback).

upxo.meshing.gbconformant.d3v2p1.parallel.single_thread_worker()[source]

Limit BLAS/OpenMP pools in a worker process to one thread, so many workers doing small array operations do not oversubscribe the cores. Uses threadpoolctl when installed; otherwise does nothing.