stilt.execution.run#
- stilt.execution.run(project, *, receptors=None, task=None, execution=None, skip_existing=True, compute_root=None)[source]#
Run every simulation of a project that has not finished, and wait for it.
Each receptor with missing results runs once: the transport model once for each distinct set of transport settings whose particles are missing, then the footprint of every variant that has a grid. With
backend: localthe receptors run in this process (cpusat a time). Withbackend: slurmthey are submitted as one job array (submit()) and this waits for it. When some simulations look unfinished after the job ends, their results are listed once moreRELIST_SECONDSlater, since a network filesystem can show this node new files late.- Parameters:
project (
Project) – Project to run.receptors (
Iterable[str] |None) – Run only these receptors (their ids), in this order.task (
tuple[int,int] |None) –(i, n): run shareiofnof the receptors here, in this process, whatever the backend. The share is everyn-th receptor in project order (or in receptors order), starting ati(task_share()), whether it is complete or not, and the complete ones are then skipped. Each task of a job array or a Kubernetes indexed Job runs one share, and every task splits the receptors the same way whenever it starts.execution (
ExecutionConfig|None) – Where to run and with what resources. Defaults to theexecutionsettings of the project’s config.skip_existing (
bool) – Skip simulations whose results all exist.Falseruns every simulation again.compute_root (
str|Path|None) – Directory the workdirs are made in, a new one for each run (resolve_compute_root()). On Slurm it is resolved on the compute node unless given here.
- Returns:
The status table (
stilt.Project.status()) of the simulations that ran:statesays which are complete, which failed and why, and which did not finish.- Return type:
- Raises:
ValueError – If a receptor id is not in the project, or task is not from 0 to
n - 1.
Notes
In a Slurm job, a task (
taskgiven) that stops with work left requeues itself withscontrol requeuewhen it was preempted (Slurm set the job’sPreemptTime) or got SIGUSR1, which the job array script asks Slurm to sendNOTICE_SECONDSbefore the time limit. It starts again later and skips what it finished. A task stopped byscancelis not requeued.