accelmo.fitting.pool¶
A pool of worker processes and the parent-side state kept for each one.
- class accelmo.fitting.pool.MetadataT¶
What the fitter keeps about each worker (tracking: its runtime metadata).
alias of TypeVar(‘MetadataT’)
- class accelmo.fitting.pool.WorkerPool[MetadataT](conns=list(), workers=list(), metadata=list(), particle_counts=list())[source]¶
Bases:
Generic[MetadataT]Worker processes, their pipes and, for tracking workers, their metadata.
metadataandparticle_countsare parallel toworkerswhen filled; pools whose workers need neither (closed-twiss) leave them empty.- Parameters:
conns (list[Connection])
workers (list[mp.Process])
metadata (list[MetadataT])
particle_counts (list[int])
- conns: list[Connection]¶
- workers: list[Process]¶
- particle_counts: list[int]¶
- spawn(worker_class, worker_id, *args)[source]¶
Start
worker_class(child_conn, worker_id, *args)and return the parent pipe end.- Return type:
Connection- Parameters:
worker_class (Callable[..., mp.Process])
worker_id (int)
args (object)
- property channels: WorkerChannels¶
Channels over every worker in the pool.