Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-12 08:24:56

0001 """Pydantic configuration model for JobLib scheduler.
0002 
0003 Registers the JobLib runner configuration with the scheduler config registry.
0004 """
0005 
0006 from typing import Optional
0007 from pydantic import BaseModel, Field
0008 
0009 from aid2e.utilities.configurations.scheduler_registry import register as register_runner_config
0010 
0011 
0012 class JobLibRunnerConfig(BaseModel):
0013     """Configuration for the JobLib-based local scheduler.
0014 
0015     Args:
0016         n_jobs: Number of workers (-1 uses all CPUs).
0017         backend: JobLib backend ("loky", "threading", or "multiprocessing").
0018         timeout: Optional per-job timeout in seconds.
0019         verbose: JobLib verbosity level (0-11).
0020     """
0021 
0022     n_jobs: int = Field(
0023         default=-1,
0024         description="Number of jobs for parallel execution. -1 means use all processors",
0025     )
0026     backend: str = Field(
0027         default="loky",
0028         description="Backend for joblib: 'loky', 'threading', or 'multiprocessing'",
0029     )
0030     timeout: Optional[int] = Field(
0031         default=None,
0032         description="Timeout in seconds for each job",
0033     )
0034     verbose: int = Field(
0035         default=0,
0036         description="Verbosity level (0-11) for joblib logging",
0037     )
0038 
0039 
0040 # Register with the runner-config registry for lookup by runner_type
0041 register_runner_config("JobLibRunner", JobLibRunnerConfig)