haddock.libs.libgrid module
- class haddock.libs.libgrid.GRIDScheduler(tasks: list[CNSJob], params: dict)[source]
Bases:
object
Scheduler to manage and run jobs on the GRID via DIRAC.
- static process_job(job: GridJob) Tuple[GridJob, bool] [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.GridJob(cnsjob: CNSJob)[source]
Bases:
object
GridJob is a class tha represents a job to be run on the GRID via DIRAC.
- static parse_output(output_str: str) dict[str, str] [source]
Parse the output string from DIRAC commands into a dictionary.
- prepare_payload(cns_exec_path: Path, cns_script_path: Path, toppar_path: Path) None [source]
Prepare the payload.zip file containing all necessary files.
- process_input_f() None [source]
Process the input file to adjust paths and identify outputs.
!! IMPORTANT !!
- This is a very important step. The .inp files coming from the modules
have several paths that are absolute paths in the local filesystem.
When this job is running in the GRID, the paths will no longer be valid.
- This processing here will identify all the paths and input files in the
.inp file and replace them with a structure that will be valid in the GRID.
!! IMPORTANT !!