The submit_batch_jobs.py module#
Summary#
Scan a directory for AEDB folders and AEDT files. |
|
Submit a single job to the job manager. |
|
Submit multiple jobs asynchronously to the job manager. |
|
Parse command-line arguments. |
|
Main entry point for the batch job submission script. |
Description#
Submit multiple HFSS jobs to the local job-manager service by scanning a directory. Job submissions are done via REST API asynchronously. The service must be running locally (default: localhost:8080) prior to executing this script. To start the service, run this command in another terminal:
python -m pyedb.workflows.job_manager.backend.job_manager_handler
Usage examples#
# Get help python submit_batch_jobs.py –help
# Submit all projects in a directory with explicit values python submit_batch_jobs.py –host 127.0.0.1 –port 8080 –root-dir “D:Temptest_jobs” –num-cores 8
# Use defaults (localhost:8080, 8 cores) python submit_batch_jobs.py –root-dir “D:Temptest_jobs”
# Recursive scan python submit_batch_jobs.py –root-dir “D:Temptest_jobs” –recursive
Module detail#
- submit_batch_jobs.scan_projects(root_dir: pathlib.Path, recursive: bool = False) List[pathlib.Path]#
Scan a directory for AEDB folders and AEDT files.
For each AEDB folder found, check if a corresponding AEDT file exists. If it does, use the AEDT file; otherwise, use the AEDB folder.
- Parameters:
- root_dir
Path Root directory to scan for projects.
- recursivebool,
optional If True, scan subdirectories recursively. Default is False.
- root_dir
- Returns:
List[Path]List of project paths (either .aedt files or .aedb folders) to submit.
- async submit_batch_jobs.submit_single_job(session: aiohttp.ClientSession, backend_url: str, project_path: pathlib.Path, num_cores: int, priority: int = 0) tuple[pathlib.Path, bool, Any]#
Submit a single job to the job manager.
- Parameters:
- Returns:
- async submit_batch_jobs.submit_batch_jobs(*, host: str, port: int, projects: List[pathlib.Path], num_cores: int, max_concurrent: int = 5, delay_ms: int = 100) None#
Submit multiple jobs asynchronously to the job manager.
- Parameters:
- host
str Job manager host address.
- port
int Job manager port.
- projects
List[Path] List of project paths to submit.
- num_cores
int Number of CPU cores to allocate per job.
- max_concurrent
int,optional Maximum number of concurrent submissions (default: 5).
- delay_ms
int,optional Delay in milliseconds between job submissions (default: 100).
- host
- submit_batch_jobs.parse_cli() argparse.Namespace#
Parse command-line arguments.
- submit_batch_jobs.logger#