Skip to content

Commit

Permalink
expose Run.wd variable via scheduler API
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Bondurant <brad.bondurant@duke.edu>
  • Loading branch information
b-bondurant committed Dec 16, 2021
1 parent 9e5e234 commit ce60806
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions artiq/frontend/artiq_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def ccb_issue(service, *args, **kwargs):
"scheduler_request_termination": scheduler.request_termination,
"scheduler_get_status": scheduler.get_status,
"scheduler_check_pause": scheduler.check_pause,
"scheduler_get_wd": scheduler.get_wd,
"ccb_issue": ccb_issue,
})
experiment_db.scan_repository_async()
Expand Down
8 changes: 8 additions & 0 deletions artiq/master/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,11 @@ def check_pause(self, rid):
return False
return r.priority_key() > run.priority_key()
raise KeyError("RID not found")

def get_wd(self, rid):
"""Returns the ``wd`` attribute of the run with the specified RID."""
for pipeline in self._pipelines.values():
if rid in pipeline.pool.runs:
run = pipeline.pool.runs[rid]
return run.wd
raise KeyError("RID not found")
7 changes: 7 additions & 0 deletions artiq/master/worker_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ def submit(self, pipeline_name=None, expid=None, priority=None, due_date=None, f
make_parent_action("scheduler_request_termination"))
get_status = staticmethod(make_parent_action("scheduler_get_status"))

_get_wd = staticmethod(make_parent_action("scheduler_get_wd"))
@host_only
def get_wd(self, rid=None):
if rid is None:
rid = self.rid
return self._get_wd(rid)


class CCB:
issue = staticmethod(make_parent_action("ccb_issue"))
Expand Down

0 comments on commit ce60806

Please sign in to comment.