From e4a631a3d72f2f2c7b121e851ad37fcd49889d8e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 22 May 2017 18:43:59 +0800 Subject: [PATCH] scheduler: consider the pipeline flushed if everything has a lower priority than us. Closes #640 --- RELEASE_NOTES.rst | 3 +++ artiq/dashboard/experiments.py | 3 ++- artiq/master/scheduler.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index fa8a83f58..e01267e35 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -43,6 +43,9 @@ Release notes those logs to the master. See the example device databases to see how to instantiate this controller. Using ``artiq_session`` ensures that a controller manager is running simultaneously with the master. +* Experiments scheduled with the "flush pipeline" option now proceed when there + are lower-priority experiments in the pipeline. Only experiments at the current + (or higher) priority level are flushed. 2.3 diff --git a/artiq/dashboard/experiments.py b/artiq/dashboard/experiments.py index 14db71313..835382652 100644 --- a/artiq/dashboard/experiments.py +++ b/artiq/dashboard/experiments.py @@ -294,7 +294,8 @@ class _ExperimentDock(QtWidgets.QMdiSubWindow): priority.valueChanged.connect(update_priority) flush = QtWidgets.QCheckBox("Flush") - flush.setToolTip("Flush the pipeline before starting the experiment") + flush.setToolTip("Flush the pipeline (of current- and higher-priority " + "experiments) before starting the experiment") self.layout.addWidget(flush, 2, 2, 1, 2) flush.setChecked(scheduling["flush"]) diff --git a/artiq/master/scheduler.py b/artiq/master/scheduler.py index 9eeeeaff4..941df76e4 100644 --- a/artiq/master/scheduler.py +++ b/artiq/master/scheduler.py @@ -204,6 +204,7 @@ class PrepareStage(TaskObject): run.status = RunStatus.flushing while not all(r.status in (RunStatus.pending, RunStatus.deleting) + or r.priority < run.priority or r is run for r in self.pool.runs.values()): ev = [self.pool.state_changed.wait(),