idmtools_platform_slurm.utils.slurm_job.slurm_job module#

This is a SlurmPlatform utility.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

idmtools_platform_slurm.utils.slurm_job.slurm_job.generate_script(platform: SlurmPlatform, command: str, template: Path | str = 'script_sbatch.sh.jinja2', batch_dir: str = None, **kwargs) None[source]#

Generate batch file sbatch.sh :param platform: Slurm Platform :param command: execution command :param template: template to be used to build batch file :param kwargs: keyword arguments used to expand functionality

Returns:

None

class idmtools_platform_slurm.utils.slurm_job.slurm_job.SlurmJob(script_path: os.PathLike, platform: 'SlurmPlatform' = None, executable: str = 'python3', script_params: List[str] = None, cleanup: bool = True)[source]#

Bases: object

script_path: PathLike#
platform: SlurmPlatform = None#
executable: str = 'python3'#
script_params: List[str] = None#
cleanup: bool = True#
initialization()[source]#
run(dry_run: bool = False, **kwargs) NoReturn[source]#
clean(cwd: str = '/home/docs/checkouts/readthedocs.org/user_builds/institute-for-disease-modeling-idmtools/checkouts/stable/docs')[source]#

Delete generated slurm job related files. :param cwd: the directory containing the files

Returns:

None

__init__(script_path: PathLike, platform: SlurmPlatform = None, executable: str = 'python3', script_params: List[str] = None, cleanup: bool = True) None#