STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.layerx.pool Namespace Reference

Classes

class  Cancelled
class  WorkerPool

Functions

None _init_worker (List[Tuple[Any, Any]] cards)
int default_workers (int tasks, Optional[int] cap=None)

Variables

float POLL_S = 0.5

Detailed Description

The worker pool every multi-burn Layer X job uses: the optimiser, the trade study and the sweep.

Each job used to build its own ``ProcessPoolExecutor`` with its own copy of the setup, the card
seeding and the shutdown, and two of the three waited for a burn to finish (one to two minutes
flown) before noticing a cancel. One pool here: spawned workers seeded with the parent's engine
cards, a map that wakes every half second to look for a cancel, and a shutdown that terminates
the workers on one.

Function Documentation

◆ _init_worker()

None engine.layerx.pool._init_worker ( List[Tuple[Any, Any]] cards)
protected
Seed this process's card cache with the parent's cards, so a worker reuses them.

Definition at line 28 of file pool.py.

◆ default_workers()

int engine.layerx.pool.default_workers ( int tasks,
Optional[int] cap = None )
One per core less one for the server, never more than there are tasks.

Definition at line 36 of file pool.py.

References max, and min.

Variable Documentation

◆ POLL_S

float engine.layerx.pool.POLL_S = 0.5

Definition at line 25 of file pool.py.