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)[source]
Bases:
objectScheduler to manage and run jobs on the GRID via DIRAC.
- static process_job(job: GridJob) None[source]
Process a single job: 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.
- static update_statuses(jobs: list[CompositeGridJob]) None[source]
Update the status of all jobs with a single DIRAC call.
- 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.