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 or Kubernetes.
The releases with missing results are split among up to
n_workerstasks of one job array, and this returns once it is submitted. The submission is a folder_slurm/<date_time>_<id>/in the project:releases.txtlists the releases to run,releases.parquetholds their checked rows fromreleases.csv,execution.yamlholds the execution settings,job.shis the script given tosbatch, and<task>.logis each task’s log. Taskirunsruntraj run <project> --releases releases.parquet --task i/N, so it does not read and check all ofreleases.csvagain. A task that is preempted or nears its time limit requeues itself and skips what it finished (seerun()).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 tofetch.shwith its log infetch.log, with the resources ofexecution.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. Withskip_existing=Falseit gets the met of every run the array makes again. Ifsbatchrefuses the array, the fetch job is cancelled. Setexecution.slurm.fetchtofalsefor no fetch job.With
backend: kubernetesit makes one indexed Job instead, whose pods each runruntraj run <project> --task I/N(runtraj.execution.kubernetes.submit_job()), and creates it withkubectl. Each task runs its share of every release of the project and skips the complete ones, so releases andskip_existing=Falseare refused there, and compute_root is each pod’s own.- Parameters:
- Returns:
The Slurm job id of the array, or the name of the Kubernetes Job, or
Nonewhen nothing needs to run.squeue -j <id>follows a job array andscancel <id>stops it;kubectl get job <name>andkubectl delete job <name>do the same for a Job. A fetch job is a job of its own: its id is logged and written tofetch.idin the submission folder, andscancelstops it too.- Return type:
- Raises:
ValueError – If the execution backend is
local, or on Kubernetes with releases orskip_existing=False.