cogwheel.utils.submit_slurm¶
- cogwheel.utils.submit_slurm(job_name, n_hours_limit, stdout_path, stderr_path, args='', sbatch_cmds=(), batch_path=None, multithreading=False)¶
Generic function to submit a job using slurm.
This function is intended to be called from other modules rather than used interactively. The job will run the calling module as script.
- Parameters:
- job_namestr
Name of slurm job.
- n_hours_limitint
Number of hours to allocate for the job.
- stdout_pathstr, os.PathLike
File name, where to direct stdout.
- stderr_pathstr, os.PathLike
File name, where to direct stderr.
- argsstr
Command line arguments for the calling module’s
main()to parse.- sbatch_cmdssequence of str
SBATCH commands, e.g.
('--mem-per-cpu=8G',).- batch_pathstr, os.PathLike, optional
File name where to save the batch script. If not provided, a temporary file will be used.
- multithreadingbool
Whether to enable automatic OMP multithreading. Defaults to
Falsebecause multithreading is found to be slower despite using more resources.