taps.executor.taskvine¶
TaskVineExecutor
¶
TaskVineExecutor(
*args: Any,
cores_per_task: int,
serverless: bool,
debug: bool = False,
**kwargs: Any
)
Bases: FuturesExecutor
TaskVine executor.
Extends TaskVine's FuturesExecutor
to enable support for serverless
mode.
Warning
The CCTools
package is not installed with TaPS. We recommend installing both
TaPS and CCTools into a Conda environment. See the
CCTools installation guide
for all options. Version 7.13.2 and later of ndcctools
is required.
Parameters:
-
args
(Any
, default:()
) –Positional arguments to pass to
FuturesExecutor
. -
cores_per_task
(int
) –Number of cores required by each task.
-
serverless
(bool
) –Enable serverless mode to preload libraries on workers.
-
debug
(bool
, default:False
) –Enable additional TaskVine logging.
-
kwargs
(Any
, default:{}
) –Keyword arguments to pass to
FuturesExecutor
.
Raises:
-
ImportError
–If
cctools
is not installed.
Source code in taps/executor/taskvine.py
submit
¶
submit(
function: Callable[P, R],
/,
*args: args,
**kwargs: kwargs,
) -> VineFuture[R]
Schedule the callable to be executed.
Parameters:
-
function
(Callable[P, R]
) –Callable to execute.
-
args
(args
, default:()
) –Positional arguments.
-
kwargs
(kwargs
, default:{}
) –Keyword arguments.
Returns:
-
VineFuture[R]
–Future
-like object representing the result of the execution of the callable.
Source code in taps/executor/taskvine.py
map
¶
map(
function: Callable[P, R],
*iterables: Iterable[args],
timeout: float | None = None,
chunksize: int = 1
) -> Iterator[R]
Map a function onto iterables of arguments.
Parameters:
-
function
(Callable[P, R]
) –A callable that will take as many arguments as there are passed iterables.
-
iterables
(Iterable[args]
, default:()
) –Variable number of iterables.
-
timeout
(float | None
, default:None
) –The maximum number of seconds to wait. If None, then there is no limit on the wait time.
-
chunksize
(int
, default:1
) –Sets the Dask batch size.
Returns:
-
Iterator[R]
–An iterator equivalent to:
map(func, *iterables)
but the calls may be evaluated out-of-order.
Source code in taps/executor/taskvine.py
TaskVineConfig
¶
Bases: ExecutorConfig
TaskVine executor plugin configuration.
Parameters:
-
name
(Literal[str]
, default:'taskvine'
) –Executor name.
-
cores_per_task
(int
, default:1
) –Number of cores per task.
-
cores_per_worker
(int | None
, default:None
) –Number of cores per worker.
-
debug
(bool
, default:False
) –Enable additional TaskVine logging.
-
factory
(bool
, default:True
) –Launch workers from a factory.
-
port
(int
, default:9123
) –Port of TaskVine manager.
-
serverless
(bool
, default:False
) –Use TaskVine serverless mode.
-
workers
(int
, default:1
) –TaskVine workers when using a factory.
get_executor
¶
Create an executor instance from the config.