pyphi.campaign.prepare#

pyphi.campaign.prepare(substrates, *, states, subsets='full', formalisms=None, compute='sia', directory, jobs=None, units_per_job=None, infeasible_threshold=1000000000.0, strict=False, container_image='pyphi.sif', request_memory='4GB', request_disk='4GB')[source]#

Materialize a sweep as a self-contained HTCondor campaign directory.

Enumerates exactly the cells pyphi.sweep() would run over the same axes, estimates each cell’s workload with pyphi.cost.estimate_analysis() under its formalism preset, packs cells into cost-balanced tasks, and writes the campaign directory: one serialized task file per condor job, each substrate serialized once, the generated submit file, and a manifest recording every estimate and packing decision. Submit with condor_submit pyphi.sub from the campaign directory; monitor and collect with status() and collect().

Parameters:
  • substrates (Any) – As in pyphi.sweep(): one substrate, a sequence, or a {label: substrate} mapping.

  • states (Any) – As in pyphi.sweep(). A callable compute must be an importable module-level function.

  • subsets (Any) – As in pyphi.sweep(). A callable compute must be an importable module-level function.

  • formalisms (Any) – As in pyphi.sweep(). A callable compute must be an importable module-level function.

  • compute (Any) – As in pyphi.sweep(). A callable compute must be an importable module-level function.

  • directory (Any) – Target directory; created, and must not already exist.

  • jobs (int, optional) – Pack cells into exactly this many cost-balanced tasks.

  • units_per_job (float, optional) – Target work units per task; the task count is ceil(total / units_per_job). Mutually exclusive with jobs; with neither, each cell is its own task.

  • infeasible_threshold (float, optional) – A single cell whose estimate exceeds this triggers a warning naming the cell (or an error with strict). The default marks cells that cannot finish in a 72-hour slot unless per-unit cost is well below a millisecond.

  • strict (bool, optional) – Escalate admission-control warnings to errors.

  • container_image (str, optional) – Substituted into the generated submit file.

  • request_memory (str, optional) – Substituted into the generated submit file.

  • request_disk (str, optional) – Substituted into the generated submit file.

Returns:

CampaignStatus – The freshly prepared ledger (all tasks pending).

Return type:

CampaignStatus