lenskit.parallel.pool#
Functions
|
Construct a |
Classes
|
LensKit multiprocessing context. |
|
LensKit worker process implementation. |
|
- lenskit.parallel.pool.multiprocess_executor(n_jobs=None, sp_config=None)#
Construct a
ProcessPoolExecutorconfigured for LensKit work.- Parameters:
n_jobs (int | None)
sp_config (ParallelConfig | None)
- Return type:
ProcessPoolExecutor
- class lenskit.parallel.pool.ProcessPoolOpInvoker(model, func, n_jobs, worker_parallel=None)#
Bases:
ModelOpInvoker[A,R],Generic[M,A,R]- Parameters:
model (M)
func (InvokeOp[M, A, R])
n_jobs (int)
worker_parallel (ParallelConfig | None)
- map(tasks)#
Apply the configured function to the model and iterables. This is like
map(), except it supplies the invoker’s model as the first object tofunc.- Parameters:
iterables – Iterables of arguments to provide to the function.
tasks (Iterable[A])
- Returns:
An iterable of the results.
- Return type:
iterable
- shutdown()#
Shut down this invoker.
- class lenskit.parallel.pool.LensKitProcess(logging, parallel, *args, **kwargs)#
Bases:
SpawnProcessLensKit worker process implementation.
- Parameters:
logging (WorkerLogConfig)
parallel (ParallelConfig)
args (Any)
kwargs (Any)
- run()#
Method to be run in sub-process; can be overridden in sub-class
- class lenskit.parallel.pool.LensKitMPContext(parallel)#
Bases:
SpawnContextLensKit multiprocessing context.
- Parameters:
parallel (ParallelConfig)