Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8b79485

Browse files
committedDec 21, 2020
expose Run.wd variable via scheduler API
Signed-off-by: Brad Bondurant <brad.bondurant@duke.edu>
1 parent e79fedd commit 8b79485

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
 

‎artiq/frontend/artiq_master.py

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def ccb_issue(service, *args, **kwargs):
123123
"scheduler_request_termination": scheduler.request_termination,
124124
"scheduler_get_status": scheduler.get_status,
125125
"scheduler_check_pause": scheduler.check_pause,
126+
"scheduler_get_wd": scheduler.get_wd,
126127
"ccb_issue": ccb_issue,
127128
})
128129
experiment_db.scan_repository_async()

‎artiq/master/scheduler.py

+8
Original file line numberDiff line numberDiff line change
@@ -485,3 +485,11 @@ def check_pause(self, rid):
485485
return False
486486
return r.priority_key() > run.priority_key()
487487
raise KeyError("RID not found")
488+
489+
def get_wd(self, rid):
490+
"""Returns the ``wd`` attribute of the run with the specified RID."""
491+
for pipeline in self._pipelines.values():
492+
if rid in pipeline.pool.runs:
493+
run = pipeline.pool.runs[rid]
494+
return run.wd
495+
raise KeyError("RID not found")

‎artiq/master/worker_impl.py

+7
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ def submit(self, pipeline_name=None, expid=None, priority=None, due_date=None, f
122122
make_parent_action("scheduler_request_termination"))
123123
get_status = staticmethod(make_parent_action("scheduler_get_status"))
124124

125+
_get_wd = staticmethod(make_parent_action("scheduler_get_wd"))
126+
@host_only
127+
def get_wd(self, rid=None):
128+
if rid is None:
129+
rid = self.rid
130+
return self._get_wd(rid)
131+
125132

126133
class CCB:
127134
issue = staticmethod(make_parent_action("ccb_issue"))

0 commit comments

Comments
 (0)
Please sign in to comment.