pyphi.parallel.sampling.plan_workload#
- pyphi.parallel.sampling.plan_workload(fn, items, more_items, *, map_kwargs, chunking, ordered, shortcircuit_active, reducer)[source]#
Cost-sample a known-length workload and fold the results into a plan.
Multi-iterable workloads are zipped into argument tuples so the sampler sees the same call shape as the real map. When collection order is unconstrained (
orderedis false and no short-circuit predicate is active), the sampled items are removed from the returned columns and their already-computed results are appended by the returned reducer, so no item is computed twice. When order is constrained, the sampled results are discarded and the full workload is dispatched, preserving the sequential-evaluation prefix semantics.A sampled chunksize estimates the number of items per
chunking.target_secondsof work, so a workload that fits within one such chunk is not worth dispatching; it is folded into the returnedsequential_threshold. An explicitly configured chunksize governs granularity only and leaves the threshold unchanged.