stilt.ExecutionConfig#

class stilt.ExecutionConfig(*, backend: Literal['local', 'slurm']='local', n_workers: Annotated[int, Ge(ge=1)] = 1, cpus: Annotated[int, Ge(ge=1)] = 1, time: str | int | None = None, mem: str | None = None, partition: str | None = None, account: str | None = None, qos: str | None = None, timeout: Annotated[int | None, Ge(ge=1)] = None, keep_workdir: bool = False, array_parallelism: Annotated[int | None, Ge(ge=1)] = None, setup: list[str] = <factory>, slurm: dict[str, typing.Any]=<factory>) → None[source]#

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

With backend: local the receptors run on this machine as one task. With backend: slurm they are split among n_workers tasks of one Slurm job array. Either way a task runs cpus receptors at once. The Slurm settings are ignored by a local run, so a config can hold them and be run either way. timeout and keep_workdir apply to both. None of these settings change a result.

Parameters#

Parameter

Description

Default

backend

Where to run: on this machine (local) or as a Slurm job array (slurm).

'local'

n_workers

Number of Slurm array tasks, which the receptors are split evenly among. A local run is one task.

1

cpus

Receptors each task runs at once: processes on this machine for a local run, CPUs per array task on Slurm.

1

time

Slurm time limit per task, as HH:MM:SS, D-HH:MM:SS, or minutes. Required with backend: slurm: without it a task gets the partition’s default, which can be days.

None

mem

Memory per Slurm task, such as 8G.

None

partition

Slurm partition.

None

account

Slurm account.

None

qos

Slurm quality of service.

None

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.

False

array_parallelism

Most Slurm tasks running at once. Unset leaves it to Slurm.

None

setup

Shell commands run in each Slurm task before the worker, such as module load lines. The worker itself runs with the Python that submitted it.

[]

slurm

Any other sbatch options by name, such as exclude: node1 or constraint: skl. true writes the bare flag.

{}