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) Path[source]#

Generate a dispatcher script that submits the next chunk and dispatcher.

The dispatcher requests minimal resources (1 CPU, 100M, 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 None for 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.

Returns:

Path to the generated dispatcher script.

Return type:

Path