calypso.dispatchers.orchestrator.machine module

class calypso.dispatchers.orchestrator.machine.Machine(machine_data: MachineData)

Bases: object

as_dict()
download_jobs(job: Job)

Calculated job may not need to download, not done!

is_accessible()

Machine is accessible if the number of running jobs is less than the max number of tasks.

serialize(to_file=True)

saving machine dictionary into file if to_file is true, else return a dict.

submit_task(job: Job | list[Job] | None = None)

submit job to given machine, if job state is unsubmitted, return the state of submitted job.

update_job_state()

Query each job state with Scheduler or set unsubmitted. Results will be saved into self.job_state.

upload_jobs(jobs: list[Job])
class calypso.dispatchers.orchestrator.machine.MachineData(executor: str, scheduler: str, scheduler_env: list[str] = <factory>, name: str = 'Machine', host: str | None = None, port: int | None = None, username: str | None = None, password: str | None = None, key_filename: str | None = None, numb_cpu_per_node: int | None = None, numb_node: int | None = None, remote_root: str | None = None, command: str | None = None, external_command: str | None = None, max_run_time: str | int = '1:00:00', machine_capacity: int = 1, max_retry: int = 5, group_size: int = 1, envs: list[str] = <factory>, additional_head_setting: list[str] = <factory>, queue: str | None = None, kwargs: dict = <factory>)

Bases: object

classmethod from_kwargs(**kwargs: dict)

ref: https://stackoverflow.com/questions/55099243/python3-dataclass-with-kwargsasterisk

as_dict()
additional_head_setting: list[str]
command: str | None = None
envs: list[str]
executor: str
external_command: str | None = None
group_size: int = 1
host: str | None = None
key_filename: str | None = None
kwargs: dict
machine_capacity: int = 1
max_retry: int = 5
max_run_time: str | int = '1:00:00'
name: str = 'Machine'
numb_cpu_per_node: int | None = None
numb_node: int | None = None
password: str | None = None
port: int | None = None
queue: str | None = None
remote_root: str | None = None
scheduler: str
scheduler_env: list[str]
username: str | None = None