dacapo.blockwise.scheduler
Module Contents
Functions
|
Run a function in parallel over a large volume. |
|
Run a segmentation function in parallel over a large volume. |
Attributes
- dacapo.blockwise.scheduler.logger
- dacapo.blockwise.scheduler.run_blockwise(worker_file: str | pathlib.Path, total_roi: funlib.geometry.Roi, read_roi: funlib.geometry.Roi, write_roi: funlib.geometry.Roi, num_workers: int = 16, max_retries: int = 1, timeout=None, upstream_tasks=None, *args, **kwargs)
Run a function in parallel over a large volume.
- Parameters:
worker_file (
strorPath) – The path to the file containing the necessary worker functions:spawn_workerandstart_worker. Optionally, the file can also contain acheck_functionand aninit_callback_fn.total_roi (
Roi) – The ROI to process.read_roi (
Roi) – The ROI to read from for a block.write_roi (
Roi) – The ROI to write to for a block.num_workers (
int) – The number of workers to use.max_retries (
int) – The maximum number of times a task will be retried if failed (either due to failed post check or application crashes or network failure)*args – Additional positional arguments to pass to
worker_function.**kwargs – Additional keyword arguments to pass to
worker_function.
- Returns:
Bool.
- dacapo.blockwise.scheduler.segment_blockwise(segment_function_file: str | pathlib.Path, context: funlib.geometry.Coordinate, total_roi: funlib.geometry.Roi, read_roi: funlib.geometry.Roi, write_roi: funlib.geometry.Roi, num_workers: int = 16, max_retries: int = 2, timeout=None, upstream_tasks=None, *args, **kwargs)
Run a segmentation function in parallel over a large volume.
- Parameters:
segment_function_file (
strorPath) – The path to the file containing the necessary worker functions:spawn_workerandstart_worker. Optionally, the file can also contain acheck_functionand aninit_callback_fn.context (
Coordinate) – The context to add to the read and write ROI.total_roi (
Roi) – The ROI to process.read_roi (
Roi) – The ROI to read from for a block.write_roi (
Roi) – The ROI to write to for a block.num_workers (
int) – The number of workers to use.max_retries (
int) – The maximum number of times a task will be retried if failed (either due to failed post check or application crashes or network failure)timeout (
int) – The maximum time in seconds to wait for a worker to complete a task.upstream_tasks (
List) – List of upstream tasks.*args – Additional positional arguments to pass to
worker_function.**kwargs – Additional keyword arguments to pass to
worker_function.
- Returns:
Bool.