runtraj.ExecutionConfig#

class runtraj.ExecutionConfig(*, backend: Literal['local', 'slurm', 'kubernetes']='local', local: runtraj.execution.config.LocalConfig = <factory>, slurm: runtraj.execution.config.SlurmConfig = <factory>, kubernetes: runtraj.execution.config.KubernetesConfig = <factory>, timeout: Annotated[int | None, Ge(ge=1)] = None, keep_workdir: bool = False) → None[source]#

Where a project’s releases run, and with what resources.

backend names the place, and every setting of that place is in the block of its name. With backend: local the releases run on this machine as one task (LocalConfig). With backend: slurm they are split among the tasks of one Slurm job array (SlurmConfig), and with backend: kubernetes among the pods of one indexed Job (KubernetesConfig). Only the block backend names is read, so a config can hold several and be run either way. timeout and keep_workdir apply wherever a run happens. None of these settings change a result.

Parameters#

Parameter

Description

Default

backend

Where to run: on this machine (local), as a Slurm job array (slurm), or as a Kubernetes indexed Job (kubernetes).

'local'

local

How a local run goes (LocalConfig). Read with backend: local.

LocalConfig(cpus=1, fetch=True)

slurm

The job array of a Slurm run (SlurmConfig), and any other sbatch option by name. Read with backend: slurm.

SlurmConfig(n_workers=1, cpus=1, time=None, mem=None, partition=None, account=None, q...

kubernetes

The indexed Job of a Kubernetes run (KubernetesConfig). Read with backend: kubernetes.

KubernetesConfig(image=None, completions=1, parallelism=None, cpus=1, memory=None, na...

timeout

Time limit for one transport model run, in seconds. A run that exceeds it is stopped and recorded as a failed simulation, and the worker moves on. Unset waits indefinitely, so a hung run can hold a worker until its job ends.

None

keep_workdir

Keep every run’s workdir, as the transport model left it, under scratch/ in the output directory. A failed run’s is always kept, without the model’s particle file unless this is set.

False

Attributes#

cpus

cpus of the block backend names.

fetch

fetch of the block backend names.