runtraj.execution.run#
- runtraj.execution.run(project, *, releases=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 release with missing results runs once: the transport model once for each distinct set of transport settings whose particles are missing, then the stages of every variant that has some. With
backend: localthe releases run in this process (cpusat a time); withcpusabove 1 and a met that downloads, the met files are got first (runtraj.Project.fetch(), unlessexecution.local.fetchisfalse), so the workers do not download the same file at once. 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.releases (
Iterable[str] |None) – Run only these releases (their ids), in this order.task (
tuple[int,int] |None) –(i, n): run shareiofnof the releases here, in this process, whatever the backend. The share is everyn-th release in project order (or in releases 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 releases 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 (
runtraj.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 release 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.