mirror of https://github.com/m-labs/artiq.git
Co-authored-by: kk105 <kkl@m-kabs.hk>
This commit is contained in:
parent
46f2842d38
commit
7aa6104872
|
@ -128,6 +128,7 @@ def main():
|
||||||
"scheduler_request_termination": scheduler.request_termination,
|
"scheduler_request_termination": scheduler.request_termination,
|
||||||
"scheduler_get_status": scheduler.get_status,
|
"scheduler_get_status": scheduler.get_status,
|
||||||
"scheduler_check_pause": scheduler.check_pause,
|
"scheduler_check_pause": scheduler.check_pause,
|
||||||
|
"scheduler_check_termination": scheduler.check_termination,
|
||||||
"ccb_issue": ccb_issue,
|
"ccb_issue": ccb_issue,
|
||||||
})
|
})
|
||||||
experiment_db.scan_repository_async()
|
experiment_db.scan_repository_async()
|
||||||
|
|
|
@ -490,3 +490,13 @@ class Scheduler:
|
||||||
return False
|
return False
|
||||||
return r.priority_key() > run.priority_key()
|
return r.priority_key() > run.priority_key()
|
||||||
raise KeyError("RID not found")
|
raise KeyError("RID not found")
|
||||||
|
|
||||||
|
def check_termination(self, rid):
|
||||||
|
"""Returns ``True`` if termination is requested."""
|
||||||
|
for pipeline in self._pipelines.values():
|
||||||
|
if rid in pipeline.pool.runs:
|
||||||
|
run = pipeline.pool.runs[rid]
|
||||||
|
if run.termination_requested:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
|
@ -111,6 +111,12 @@ class Scheduler:
|
||||||
rid = self.rid
|
rid = self.rid
|
||||||
return self._check_pause(rid)
|
return self._check_pause(rid)
|
||||||
|
|
||||||
|
_check_termination = staticmethod(make_parent_action("scheduler_check_termination"))
|
||||||
|
def check_termination(self, rid=None) -> TBool:
|
||||||
|
if rid is None:
|
||||||
|
rid = self.rid
|
||||||
|
return self._check_termination(rid)
|
||||||
|
|
||||||
_submit = staticmethod(make_parent_action("scheduler_submit"))
|
_submit = staticmethod(make_parent_action("scheduler_submit"))
|
||||||
def submit(self, pipeline_name=None, expid=None, priority=None, due_date=None, flush=False):
|
def submit(self, pipeline_name=None, expid=None, priority=None, due_date=None, flush=False):
|
||||||
if pipeline_name is None:
|
if pipeline_name is None:
|
||||||
|
|
Loading…
Reference in New Issue