One Dask worker corresponds to one node.
| 25 | |
| 26 | @dataclasses.dataclass(frozen=True) |
| 27 | class DaskWorkerConfig: |
| 28 | """ |
| 29 | One Dask worker corresponds to one node. |
| 30 | """ |
| 31 | |
| 32 | processes: int |
| 33 | threads_per_process: int |
| 34 | node: Optional[int] = None |
| 35 | init_cmd: List[str] = dataclasses.field(default_factory=list) |
| 36 | |
| 37 | @staticmethod |
| 38 | def create(count: int, n_processes: int = 1, **kwargs) -> "DaskWorkerConfig": |
| 39 | assert count % n_processes == 0 |
| 40 | return DaskWorkerConfig(processes=n_processes, threads_per_process=count // n_processes, **kwargs) |
| 41 | |
| 42 | |
| 43 | @dataclasses.dataclass(frozen=True) |
no outgoing calls
no test coverage detected