cars.orchestrator.cluster.mp_cluster.mp_objects
Contains class objects used by multiprocessing cluster
Classes
Encapsulation of multiprocessing job Id (internal use for mp_local_cluster) |
|
Delayed task |
|
multiprocessing version of dask.delayed |
|
Multiprocessing version of distributed.future |
|
iterator on multiprocessing.pool.AsyncResult, similar to as_completed |
|
Object used in FactorisedObject for args already computed |
|
Object used as args of function factorised_func |
Functions
Replace MpDelayed by PreviousData object |
|
|
Replace PreviousData object by real data |
Module Contents
- class cars.orchestrator.cluster.mp_cluster.mp_objects.MpJob(idx, return_index)[source]
Encapsulation of multiprocessing job Id (internal use for mp_local_cluster)
- __slots__ = ['task_id', 'r_idx']
- task_id
- r_idx
- class cars.orchestrator.cluster.mp_cluster.mp_objects.MpDelayedTask(func, args, kw_args)[source]
Delayed task
- func
- args
- kw_args
- associated_objects = []
- class cars.orchestrator.cluster.mp_cluster.mp_objects.MpDelayed(delayed_task, return_index=0)[source]
multiprocessing version of dask.delayed
- delayed_task
- return_index = 0
- class cars.orchestrator.cluster.mp_cluster.mp_objects.MpFuture(mp_future_task, return_index)[source]
Multiprocessing version of distributed.future
- mp_future_task
- result = None
- _success = None
- return_index
- event
- class cars.orchestrator.cluster.mp_cluster.mp_objects.MpFutureIterator(future_list, cluster, timeout=None)[source]
iterator on multiprocessing.pool.AsyncResult, similar to as_completed Only returns the actual results, delete the future after usage
- future_list
- cluster
- was_killed = False
- timeout = None
- past_time
- class cars.orchestrator.cluster.mp_cluster.mp_objects.PreviousData(delayed)[source]
Object used in FactorisedObject for args already computed in factorized function
- return_index
- cars.orchestrator.cluster.mp_cluster.mp_objects.transform_mp_delayed_to_previous_data(obj)[source]
Replace MpDelayed by PreviousData object
- Parameters:
data – data to replace if necessary
- cars.orchestrator.cluster.mp_cluster.mp_objects.transform_previous_data_to_results(obj, res)[source]
Replace PreviousData object by real data
- Parameters:
data – data to replace if necessary
- class cars.orchestrator.cluster.mp_cluster.mp_objects.FactorizedObject(current_task, previous_task)[source]
Object used as args of function factorised_func It contains several tasks that can be run within a single function