generate_run
This module provides functions to generate run files for jobs in different environments (local/Slurm and HTCondor). It includes functions to create shell script snippets for tagging jobs as finished and generating run files with appropriate configurations.
Functions:
| Name | Description |
|---|---|
tag_str |
str) -> str: |
generate_run_file |
str, job_name: str, setup_env_script: str, generation_number: int, tree_path: str, l_keys: list[str], htc: bool = False, additionnal_command: str = "", l_dependencies: list[str] | None = None, name_config: str = "config.yaml") -> str: |
_generate_run_file |
str, job_name: str, setup_env_script: str, tree_path: str, l_keys: list[str], additionnal_command: str = "") -> str: |
_generate_run_file_htc |
str, job_name: str, setup_env_script: str, generation_number: int, tree_path: str, l_keys: list[str], additionnal_command: str = "", l_dependencies: list[str] | None = None, name_config: str = "config.yaml") -> str: |
generate_run_file(abs_job_folder, job_name, setup_env_script, htc=False, slurm_docker_fix=True, additionnal_command='', **kwargs_htc_run_files)
Generates a run file for a job, either for local/Slurm or HTC environments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
abs_job_folder
|
str
|
The (absolute) folder where the job is located. |
required |
job_name
|
str
|
The name of the job script. |
required |
setup_env_script
|
str
|
The script to set up the environment. |
required |
htc
|
bool
|
Whether the job shoud be run on HTCondor. Defaults to False. |
False
|
slurm_docker_fix
|
bool
|
Whether to fix the Docker issue with recovery path on Slurm. Defaults to False. |
True
|
additionnal_command
|
str
|
Additional command to run. Defaults to "". |
''
|
**kwargs_htc_run_files
|
Any
|
Additional keyword arguments for the generate_run_files method when submitting HTC jobs. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The generated run file content. |
Source code in study_da/submit/generate_run.py
tag_str(abs_job_folder)
" Generates a shell script snippet to tag a job as finished if it was successful. Args: abs_job_folder (str): The (absolute) folder where the job is located. Returns: str: A formatted string containing the shell script snippet.