phenotypic.sdk_.slurm.generate_dispatcher_chain#

phenotypic.sdk_.slurm.generate_dispatcher_chain(chunk_scripts: List[Path], output_dir: Path, slurm_args: Dict[str, Any], log_dir: Path, finalizer_script: Path | None = None, continuation_dependency_kinds: Sequence[Literal['afterany', 'afterok']] | None = None, generation: str | None = None, lifecycle_output_dir: Path | None = None) List[Path][source]#

Generate dispatcher scripts for a chain of chunk scripts.

For N chunk scripts, generates N-1 dispatcher scripts. Each dispatcher submits the next chunk and (if not last) the next dispatcher with the corresponding dependency kind on that chunk.

Parameters:
  • chunk_scripts (List[Path]) – Ordered list of array job chunk script paths.

  • output_dir (Path) – Directory to write dispatcher scripts into.

  • slurm_args (Dict[str, Any]) – SLURM parameters dict (partition, etc.).

  • log_dir (Path) – Directory for dispatcher log files.

  • finalizer_script (Path | None) – Terminal finalizer passed only to the last dispatcher in the chain.

  • continuation_dependency_kinds (Sequence[Literal['afterany', 'afterok']] | None) – Dependency kind for every chunk-to-continuation edge. The sequence has N - 1 entries without a finalizer and N entries with one. Defaults to afterany for every edge.

  • generation (str | None) – Optional explicit lifecycle generation. When supplied, dispatcher scripts are isolated under that generation.

  • lifecycle_output_dir (Path | None) – Optional lifecycle fence root when dispatcher scripts themselves are written beneath a separate control root.

Returns:

List of dispatcher script paths (one fewer than chunk_scripts, since the last chunk does not need a dispatcher). Empty if only one chunk exists.

Return type:

List[Path]