pysqa.wrapper.gent.GentCommands#
- class pysqa.wrapper.gent.GentCommands[source]#
Bases:
SlurmCommands- __init__()#
Methods
__init__()convert_queue_status(queue_status_output)Converts the queue status output into a pandas DataFrame.
dependencies(dependency_list)Returns the dependencies for the job.
get_job_id_from_output(queue_submit_output)Extracts the job ID from the queue submit output.
get_queue_from_output(queue_submit_output)Extracts the queue name from the queue submit output.
render_submission_template(command[, ...])Generate the job submission template.
Attributes
Returns the command to delete a job from Slurm.
Returns the command to enable job reservation on the scheduler.
Returns the command to get the queue status from Slurm.
Returns the command to submit a job to Slurm.
- static convert_queue_status(queue_status_output: str) DataFrame | None[source]#
Converts the queue status output into a pandas DataFrame.
- Parameters:
queue_status_output (str) – The output of the queue status command.
- Returns:
The converted queue status.
- Return type:
pandas.DataFrame
- property delete_job_command: list[str]#
Returns the command to delete a job from Slurm.
- static dependencies(dependency_list: list[str]) list[str][source]#
Returns the dependencies for the job.
- Parameters:
dependency_list (list[str]) – The list of job dependencies.
- Returns:
The dependencies for the job.
- Return type:
list[str]
- Raises:
NotImplementedError – If dependency_list is not None.
- property enable_reservation_command: list[str]#
Returns the command to enable job reservation on the scheduler.
- Returns:
The command to enable job reservation.
- Return type:
list[str]
- static get_job_id_from_output(queue_submit_output: str) int[source]#
Extracts the job ID from the queue submit output.
- Parameters:
queue_submit_output (str) – The output of the queue submit command.
- Returns:
The job ID.
- Return type:
int
- static get_queue_from_output(queue_submit_output: str) str[source]#
Extracts the queue name from the queue submit output.
- Parameters:
queue_submit_output (str) – The output of the queue submit command.
- Returns:
The queue name.
- Return type:
str
- property get_queue_status_command: list[str]#
Returns the command to get the queue status from Slurm.
- static render_submission_template(command: str, submission_template: str | Template = "#!/bin/bash\n#SBATCH --output=time.out\n#SBATCH --job-name={{job_name}}\n#SBATCH --chdir={{working_directory}}\n#SBATCH --get-user-env=L\n#SBATCH --partition={{partition}}\n{%- if run_time_max %}\n#SBATCH --time={{ [1, run_time_max // 60]|max }}\n{%- endif %}\n{%- if dependency_list %}\n#SBATCH --dependency=afterok:{{ dependency_list | join(',') }}\n{%- endif %}\n{%- if memory_max %}\n#SBATCH --mem={{memory_max}}G\n{%- endif %}\n#SBATCH --ntasks={{cores}}\n\n{{command}}\n", job_name: str = 'pysqa', working_directory: str = '/home/docs/checkouts/readthedocs.org/user_builds/pysqa/checkouts/latest/docs', cores: int = 1, memory_max: int | str | None = None, run_time_max: int | None = None, dependency_list: list[int] | None = None, **kwargs) str#
Generate the job submission template.
- Parameters:
command (str, optional) – The command to be executed.
job_name (str, optional) – The job name. Defaults to “pysqa”.
working_directory (str, optional) – The working directory. Defaults to “.”.
cores (int, optional) – The number of cores. Defaults to 1.
memory_max (int, optional) – The maximum memory. Defaults to None.
run_time_max (int, optional) – The maximum run time. Defaults to None.
dependency_list (list[int], optional) – The list of dependency job IDs. Defaults to None.
submission_template (str) – Submission script template pysqa.wrapper.flux.template
- Returns:
The rendered job submission template.
- Return type:
str
- property submit_job_command: list[str]#
Returns the command to submit a job to Slurm.