Skip to main content

Module worker

Module worker 

Source
Expand description

Small blocking worker SDK. Solver state is private to each task; results are committed before a completed task is reported. No solver checkpoint is implied.

Structs§

TaskResult
What Prepared::solve returns for one task.

Traits§

Prepared
A validated job, ready to solve its tasks. execute calls solve from up to outer_workers threads at once.
Worker
The solver behind one worker ID. run turns it into a worker binary with the commands describe, validate and execute.

Functions§

description
A worker description of protocol PROTOCOL: the engine and its version, the profiles, the registered problems and the largest inner_threads.
execute
Executes the job in the attempt directory dir: validates resolved.json, solves the tasks on up to outer_workers threads, appends each result to results.jsonl and writes run.json. A cancel.request file or the wall time stops the remaining tasks. An attempt that already has a journal or a manifest is refused: a job is never resumed.
run
The main of a worker binary: describe, validate SPEC or execute JOB_DIRECTORY. It prints its JSON answer, or exits with status 1 and {"error":{"code":"worker_error","message":...}} on standard error.