Skip to content

_local

JobRunnerConfigLocal

Bases: BaseModel

Runner-configuration specifications, for a local resource.

The typical use case is that setting parallel_tasks_per_job to a small number (e.g. 1) will limit parallelism when executing tasks requiring a large amount of resources (e.g. memory) on a local machine.

ATTRIBUTE DESCRIPTION
parallel_tasks_per_job

Maximum number of tasks to be run in parallel within a local runner. If None, then all tasks may start at the same time.

TYPE: int | None

Source code in fractal_server/runner/config/_local.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class JobRunnerConfigLocal(BaseModel):
    """
    Runner-configuration specifications, for a `local` resource.

    The typical use case is that setting `parallel_tasks_per_job` to a
    small number (e.g. 1) will limit parallelism when executing tasks
    requiring a large amount of resources (e.g. memory) on a local machine.

    Attributes:
        parallel_tasks_per_job:
            Maximum number of tasks to be run in parallel within a local
            runner. If `None`, then all tasks may start at the same time.
    """

    model_config = ConfigDict(extra="forbid")
    parallel_tasks_per_job: int | None = None

    @property
    def batch_size(self) -> int:
        return self.parallel_tasks_per_job or 0