ai2_kit.core.executor module#
- pydantic model ai2_kit.core.executor.BaseExecutorConfig[source]#
Bases:
BaseModel
Show JSON schema
{ "title": "BaseExecutorConfig", "type": "object", "properties": { "ssh": { "anyOf": [ { "$ref": "#/$defs/SshConfig" }, { "type": "null" } ], "default": null }, "queue_system": { "$ref": "#/$defs/QueueSystemConfig" }, "work_dir": { "title": "Work Dir", "type": "string" }, "python_cmd": { "default": "python", "title": "Python Cmd", "type": "string" } }, "$defs": { "LSF": { "additionalProperties": false, "properties": { "bsub_bin": { "default": "bsub", "title": "Bsub Bin", "type": "string" }, "bjobs_bin": { "default": "bjobs", "title": "Bjobs Bin", "type": "string" }, "polling_interval": { "default": 10, "title": "Polling Interval", "type": "integer" } }, "title": "LSF", "type": "object" }, "PBS": { "additionalProperties": false, "properties": { "qsub_bin": { "default": "qsub", "title": "Qsub Bin", "type": "string" }, "qstat_bin": { "default": "qstat", "title": "Qstat Bin", "type": "string" }, "qdel_bin": { "default": "qdel", "title": "Qdel Bin", "type": "string" } }, "title": "PBS", "type": "object" }, "QueueSystemConfig": { "additionalProperties": false, "properties": { "slurm": { "anyOf": [ { "$ref": "#/$defs/Slurm" }, { "type": "null" } ], "default": null }, "lsf": { "anyOf": [ { "$ref": "#/$defs/LSF" }, { "type": "null" } ], "default": null }, "pbs": { "anyOf": [ { "$ref": "#/$defs/PBS" }, { "type": "null" } ], "default": null } }, "title": "QueueSystemConfig", "type": "object" }, "Slurm": { "additionalProperties": false, "properties": { "sbatch_bin": { "default": "sbatch", "title": "Sbatch Bin", "type": "string" }, "squeue_bin": { "default": "squeue", "title": "Squeue Bin", "type": "string" }, "scancel_bin": { "default": "scancel", "title": "Scancel Bin", "type": "string" }, "polling_interval": { "default": 10, "title": "Polling Interval", "type": "integer" } }, "title": "Slurm", "type": "object" }, "SshConfig": { "additionalProperties": false, "properties": { "host": { "title": "Host", "type": "string" }, "gateway": { "anyOf": [ { "$ref": "#/$defs/SshConfig" }, { "type": "null" } ], "default": null } }, "required": [ "host" ], "title": "SshConfig", "type": "object" } }, "additionalProperties": false, "required": [ "queue_system", "work_dir" ] }
- Config:
extra: str = forbid
- Fields:
- field python_cmd: str = 'python'#
- field queue_system: QueueSystemConfig [Required]#
- field work_dir: str [Required]#
- class ai2_kit.core.executor.Executor[source]#
Bases:
ABC
- name: str#
- python_cmd: str#
- tmp_dir: str#
- work_dir: str#
- class ai2_kit.core.executor.ExecutorManager(executor_configs: Mapping[str, BaseExecutorConfig])[source]#
Bases:
object
- class ai2_kit.core.executor.HpcExecutor(connector: BaseConnector, queue_system: BaseQueueSystem, work_dir: str, python_cmd: str, name: str)[source]#
Bases:
Executor
- classmethod from_config(config: dict | BaseExecutorConfig, name: str = '')[source]#
- property is_local#
- ai2_kit.core.executor.create_executor(config: BaseExecutorConfig, name: str) Executor [source]#