libhpc: HPC execution functions
Module in charge of running tasks in HPC.
- class haddock.libs.libhpc.HPCScheduler(task_list: list[CNSJob], target_queue: str = '', queue_limit: int = 100, concat: int = 1)[source]
Bases:
object
Schedules tasks to run in HPC.
- class haddock.libs.libhpc.HPCWorker(tasks: list[CNSJob], num: int, job_id: int | None = None, workfload_manager: str = 'slurm', queue: str | None = None)[source]
Bases:
object
Defines the HPC Job.
- cancel(bypass_statuses: Container[str] = ('finished', 'failed')) None [source]
Cancel the execution.
- haddock.libs.libhpc.create_CNS_export_envvars(**envvars: Any) str [source]
Create a string exporting envvars needed for CNS.
- Parameters:
envvars (dict) – A dictionary containing envvariables where keys are var names and values are the values.
- Returns:
str – In the form of: export VAR1=VALUE1 export VAR2=VALUE2 export VAR3=VALUE3
- haddock.libs.libhpc.create_slurm_header(job_name: str | Path = 'haddock3_slurm_job', work_dir: str | Path = '.', stdout_path: str | Path = 'haddock3_job.out', stderr_path: str | Path = 'haddock3_job.err', queue: str | None = None, ncores: int = 48) str [source]
Create HADDOCK3 Slurm Batch job file.
- Parameters:
job_name (str) – The name of the job.
work_dir (pathlib.Path) – The working dir of the example. That is, the directory where input, jobs, and logs reside. Injected in create_job_header.
time (int) – Time in minutes before job reach TIMEOUT status.
**job_params – According to job_setup.
- Returns:
str – Slurm-based job file for HADDOCK3.
- haddock.libs.libhpc.create_torque_header(job_name: str | Path = 'haddock3_slurm_job', work_dir: str | Path = '.', stdout_path: str | Path = 'haddock3_job.out', stderr_path: str | Path = 'haddock3_job.err', queue: str | None = None, ncores: int = 48) str [source]
Create HADDOCK3 Alcazar job file.
- Parameters:
job_name (str) – The name of the job.
work_dir (pathlib.Path) – The working dir of the example. That is, the directory where input, jobs, and logs reside. Injected in create_job_header.
**job_params – According to job_setup.
- Returns:
str – Torque-based job file for HADDOCK3 benchmarking.