phenotypic.sdk_.aggregation_shard_dir#

phenotypic.sdk_.aggregation_shard_dir(output_dir: Path, scheduler_epoch: str | None) Path[source]#

Return <progress>/aggregation_shards/<scheduler_epoch>/.

Spec §7.5: the fan-out’s measurement shards are per-invocation scratch, so a prior run’s shards can never be merged into this run’s master. Recompile already namespaces its shards this way under recompile/attempts/<attempt_id>/; this generalises the pattern to the forward path.

The namespace is not the correctness argument, and must not be read as one. _scheduler_epoch returns None for every local run, so consecutive local invocations share LOCAL_SCHEDULER_EPOCH and would collide. The fan-out therefore empties this directory when it starts, on both drivers, at the same logical point – which is strictly stronger than namespacing, since namespacing also leaves every prior run’s shards on disk accumulating forever. The epoch stays in the path because it costs nothing and keeps one path shape across the two drivers.

Pure path expression; callers mkdir when they intend to write.

Parameters:
  • output_dir (Path) – Run output root.

  • scheduler_epoch (str | None) – The active SLURM lifecycle generation, or None for a local run.

Returns:

The shard directory for this invocation.

Return type:

Path