Joblib Executor

class orion.executor.multiprocess_backend.Pool(processes=None, initializer=None, initargs=(), maxtasksperchild=None, context=None)[source]

Custom pool that does not set its worker as daemon process

Methods

Process

shutdown

class orion.executor.multiprocess_backend.PoolExecutor(n_workers=-1, backend='multiprocess', **kwargs)[source]

Simple Pool executor.

Parameters
n_workers: int

Number of workers to spawn

backend: str

Pool backend to use; thread or multiprocess, defaults to multiprocess

.. warning::

Pickling of the executor is not supported, see Dask for a backend that supports it

Methods

async_get(futures[, timeout])

Retrieve futures that completed, removes them from the list of pending futures and return their results

submit(function, *args, **kwargs)

Submit work to the executor for asynchronous execution

wait(futures)

Wait for all futures to complete execution.

close

async_get(futures, timeout=None)[source]

Retrieve futures that completed, removes them from the list of pending futures and return their results

Parameters
futures: `concurrent.futures.Futures` or equivalent interface

The objects returned by submit() of the executor.

timeout: int

time to wait before checking the other future

Returns
returns a list of results
submit(function, *args, **kwargs)[source]

Submit work to the executor for asynchronous execution

Parameters
function: a callable object

A function to be executed by the executor. The function must be serializable.

*args, **kwargs:

Arguments for the function. The arguments must be serializable.

wait(futures)[source]

Wait for all futures to complete execution.

Parameters
futures: `concurrent.futures.Futures` or equivalent interface

The objects returned by submit() of the executor.

class orion.executor.multiprocess_backend.ThreadPool(n_workers)[source]

Custom pool that creates multiple threads instead of processes

Methods

apply_async

shutdown