runtraj.execution.submit#

runtraj.execution.submit(project, *, releases=None, execution=None, skip_existing=True, compute_root=None)[source]#

Submit every simulation of a project that has not finished to Slurm.

The releases with missing results are split among up to n_workers tasks of one job array, and this returns once it is submitted. The submission is a folder _slurm/<date_time>_<id>/ in the project: releases.txt lists the releases to run, releases.parquet holds their checked rows from releases.csv, execution.yaml holds the execution settings, job.sh is the script given to sbatch, and <task>.log is each task’s log. Task i runs runtraj run <project> --releases releases.parquet --task i/N, so it does not read and check all of releases.csv again. A task that is preempted or nears its time limit requeues itself and skips what it finished (see run()).

When a met the unfinished simulations use downloads its files, a fetch job goes first: one task that runs runtraj fetch <project> --releases releases.parquet (fetch_script()), written to fetch.sh with its log in fetch.log, with the resources of execution.slurm.fetch. The array waits for it to end (--dependency=afterany), however it ended, so the runs whose met it got go ahead, and each task downloads what is still missing. With skip_existing=False it gets the met of every run the array makes again. If sbatch refuses the array, the fetch job is cancelled. Set execution.slurm.fetch to false for no fetch job.

Parameters:
Returns:

The Slurm job id of the array, or None when nothing needs to run. squeue -j <id> follows it and scancel <id> stops it. A fetch job is a job of its own: its id is logged and written to fetch.id in the submission folder, and scancel stops it too.

Return type:

str | None

Raises:

ValueError – If the execution backend is not Slurm.