2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-05 09:46:36 +08:00
artiq/examples/master/repository/utilities/terminate_all.py

18 lines
510 B
Python
Raw Normal View History

2016-01-26 07:03:01 +08:00
from artiq.experiment import *
class TerminateAll(EnvExperiment):
def build(self):
self.setattr_device("scheduler")
self.setattr_argument("graceful_termination", BooleanValue(True))
def run(self):
if self.graceful_termination:
terminate = self.scheduler.request_termination
else:
terminate = self.scheduler.delete
for rid in self.scheduler.get_status().keys():
if rid != self.scheduler.rid:
terminate(rid)