phenotypic.sdk_.slurm.generate_dispatcher_script#
- phenotypic.sdk_.slurm.generate_dispatcher_script(next_chunk_script: Path, next_dispatcher_script: Path | None, output_path: Path, slurm_args: Dict[str, Any], log_dir: Path, *, output_dir: Path | None = None, generation: str | None = None, chunk_index: int = 1, finalizer_script: Path | None = None, dependency_kind: Literal['afterany', 'afterok'] = 'afterany') Path[source]#
Generate a dispatcher script that submits the next chunk and dispatcher.
The dispatcher requests control-plane resources (1 CPU, 512M, 5 min) and invokes the Python lifecycle entry point. That entry point durably submits the next processing chunk and optional dependent dispatcher.
- Parameters:
next_chunk_script (Path) – Path to the next array job chunk script.
next_dispatcher_script (Path | None) – Path to the next dispatcher script, or
Nonefor the last chunk (no further dispatcher needed).output_path (Path) – Where to write the generated dispatcher script.
slurm_args (Dict[str, Any]) – SLURM parameters dict (used to extract partition).
log_dir (Path) – Directory for dispatcher log files.
output_dir (Path | None) – Base output directory containing the lifecycle state.
generation (str | None) – Exact scheduler generation for lifecycle submissions.
chunk_index (int) – Zero-based index of the chunk this dispatcher submits.
finalizer_script (Path | None) – Terminal finalizer submitted after the last chunk becomes terminal.
dependency_kind (Literal['afterany', 'afterok']) – Dependency condition for the continuation submitted after
next_chunk_script.
- Returns:
Path to the generated dispatcher script.
- Return type: