haddock.libs.libgrid module
- class haddock.libs.libgrid.CompositeGridJob(input: list[str], toppar_path: Path, module_path: Path)[source]
Bases:
GridInterface
- class haddock.libs.libgrid.GRIDScheduler(tasks: list[CNSJob], params: dict, probing: float = 0.05)[source]
Bases:
objectScheduler to manage and run jobs on the GRID via DIRAC.
- static calculate_optimal_batch_size(N: int, W: float, R: float, T: float) int[source]
Calculate the optimal batch size to achieve target efficiency.
- probe_grid_efficiency() None[source]
Submit a small number of jobs to probe the efficiency of the GRID.
- static process_job(job: GridJob) None[source]
Process a single job: update status, retrieve output if done, handle retries if failed.
- NOTE: This function is parallelized, that is why things like cleaning, download, retry
are here. If you are adding new functionality, consider if it should be here or in the sequential part of the code.
- class haddock.libs.libgrid.GridInterface(input: Path | str | list[str], toppar_path: Path, module_path: Path)[source]
Bases:
ABC- static parse_output(output_str: str) dict[str, str][source]
Parse the output string from DIRAC commands into a dictionary.
- prepare_payload(cns_script_path: Path, toppar_path: Path) None[source]
Prepare the payload.zip file containing all necessary files.
- abstract process_input_f() None[source]
Process the input file to adjust paths and identify outputs.
- retrieve_output() None[source]
Retrieve the output files from DIRAC.
- The dirac-wms-job-get-output command downloads the output sandbox, this means that
anything that was specified in the OutputSandbox section of the JDL file will be put in the current working directory following the pattern: working_dir/job_id/
- class haddock.libs.libgrid.GridJob(input: Path | str, toppar_path: Path, module_path: Path)[source]
Bases:
GridInterfaceGridJob is a class tha represents a job to be run on the GRID via DIRAC.
- class haddock.libs.libgrid.JobStatus(value)[source]
Bases:
EnumAn enumeration.
- COMPLETING = 'Completing'
- DONE = 'Done'
- FAILED = 'Failed'
- MATCHED = 'Matched'
- RUNNING = 'Running'
- STAGED = 'Staged'
- UNKNOWN = 'Unknown'
- WAITING = 'Waiting'