runtraj.execution.PbsConfig#

class runtraj.execution.PbsConfig(*, cpus: Annotated[int, Ge(ge=1)] = 1, fetch: Literal[False] = False, n_workers: Annotated[int, Ge(ge=1)] = 1, n_tasks: Annotated[int | None, Ge(ge=1)] = None, walltime: str | int | None = None, mem: str | None = None, queue: str | None = None, account: str | None = None, setup: list[str] = <factory>, **extra_data: Any) → None[source]#

The PBS job array a project’s releases run as: the pbs block of execution.

As on Slurm, the releases are split among n_tasks array tasks (subjobs), at most n_workers running at once, and each task runs cpus of them at once. The settings use PBS’s own names where it has them. Any key that is not a setting below is a PBS resource by its name, written as #PBS -l <key>=<value>, such as place: scatter; select replaces the chunk runtraj asks for (1:ncpus=<cpus>:mem=<mem>), for a resource a chunk must name, such as ngpus.

PBS sends no notice before walltime, and a user cannot put a subjob back in the queue, so a task that runs out of time stays stopped: run the project again, and it skips what finished. A task that PBS preempts is put back by PBS itself (the job is rerunnable, -r y). There is no fetch job: each task downloads the met files its releases lack, so get them first with runtraj fetch when many tasks share them.

Parameters#

Parameter

Description

Default

cpus

Releases each subjob runs at once, and the CPUs (ncpus) it asks for.

1

fetch

PBS runs have no fetch job: each subjob gets the met files it lacks.

False

n_workers

Most subjobs running at once (-J 0-199%20 for 20).

1

n_tasks

Number of subjobs, which the releases are split evenly among. Unset, ten per worker. Never more than one per release, nor more than the server’s max_array_size.

None

walltime

Time limit per subjob, as HH:MM:SS or seconds. Required with backend: pbs.

None

mem

Memory per subjob, such as 8gb.

None

queue

PBS queue (-q).

None

account

Project or account to charge (-A).

None

setup

Shell commands run in each subjob before the worker, such as module load lines.

[]

Attributes#

resources

every key of the block that is not one of its settings.

tasks

n_tasks, or ten per worker when it is unset.

Methods#

check()

Raise when the subjobs have no walltime.