Skip to content

Gather — parallel jobs, client-side

gridweave.gather([...]) waits for a batch of submitted jobs and hands back their results in order. The design point worth knowing: it's entirely client-side — there is no gather endpoint on the gateway. It just fans out submit() calls, then polls each job's existing status / logs / result endpoints, so nothing new is needed server-side.

Behavior: - Results come back in submit order, no matter which job finishes first. - Each job's logs stream to stdout, prefixed [Job N]. - Fail-fast — if any job fails, it raises RuntimeError listing every failure. - Empty input returns [] immediately. - It polls all in-flight jobs in parallel each cycle (a thread pool) and backs off while idle (0.5 s → 5 s), snapping back to fast polling the moment new output appears — so 100 jobs sitting in one gather() don't hammer the platform.

Usage examples live in the SDK README; tests in tests/gather/ (test_gather mocked, test_cluster_* on real NVIDIA/AMD GPUs).