psimulate Jobs

vivarium_cluster_tools.psimulate.jobs.generate_task_id(input_draw, random_seed, branch_configuration)[source]

Generate a deterministic task ID from job-specific parameters.

Uses SHA-256 hash of canonical JSON serialization of the job-specific parameters (input_draw, random_seed, branch_configuration).

Return type:

str

Parameters:
  • input_draw (int) – The input draw number.

  • random_seed (int) – The random seed.

  • branch_configuration (dict[str, Any]) – The branch configuration dictionary.

Returns:

A hex string of the first 8 bytes (16 hex chars) of the SHA-256 hash.

class vivarium_cluster_tools.psimulate.jobs.JobParameters(model_specification, branch_configuration, input_draw, random_seed, results_path, worker_logging_root, backup_configuration, extras)[source]

Parameters for a single distributed simulation job.

Parameters:
model_specification: str

Alias for field number 0

branch_configuration: dict[str, Any]

Alias for field number 1

input_draw: int

Alias for field number 2

random_seed: int

Alias for field number 3

results_path: str

Alias for field number 4

worker_logging_root: str

Alias for field number 5

backup_configuration: dict[str, Any]

Alias for field number 6

extras: dict[str, Any]

Alias for field number 7

property task_id: str

Deterministic task ID derived from job-specific parameters.

property shared: dict[str, Any]

Parameters shared by all jobs in a psimulate run.

property job_specific: dict[str, Any]

Parameters that vary by job in a psimulate run.

property sim_config: dict[str, Any]

Parameters for the simulation configuration.

to_dict()[source]
Return type:

dict[str, Any]

vivarium_cluster_tools.psimulate.jobs.build_job_list(model_specification_path, output_root, keyspace, finished_sim_metadata, backup_freq, backup_dir, backup_metadata_path, worker_logging_root, extras)[source]
Return type:

tuple[list[JobParameters], int]

Parameters:
  • model_specification_path (Path)

  • output_root (Path)

  • keyspace (Keyspace)

  • finished_sim_metadata (DataFrame)

  • backup_freq (int | None)

  • backup_dir (Path)

  • backup_metadata_path (Path)

  • worker_logging_root (Path)

  • extras (dict[str, Any])

vivarium_cluster_tools.psimulate.jobs.already_complete(job_parameters, finished_sim_metadata)[source]
Return type:

bool

Parameters:
  • job_parameters (JobParameters)

  • finished_sim_metadata (DataFrame)