runtraj.execution.job_script#

runtraj.execution.job_script(project, execution, folder, n_tasks, *, skip_existing=True, compute_root=None)[source]#

Return the sbatch script of a job array whose tasks each run a share of the releases.

Task i runs runtraj run <project> --releases <folder>/releases.parquet --task i/n_tasks --execution <folder>/execution.yaml --cpus <cpus> with the Python that called this: a task runs its share here, cpus releases at once. The #SBATCH lines come from execution’s slurm block: its resources, --requeue, --signal=B:USR1@120 (see run()), and its other sbatch options, which can replace any of them. Its setup commands run before the task, after the script exports OMP_NUM_THREADS as the task’s CPUs divided by the workers it runs at once (cpus), which a setup line can export again. NumPy’s BLAS follows it, so a worker does not start a thread pool the size of the node.

Return type:

str

Parameters:
  • project (runtraj.project.Project)

  • execution (ExecutionConfig)

  • folder (Path)

  • n_tasks (int)

  • skip_existing (bool)

  • compute_root (str | Path | None)