From 5442ae312f5d2677620ac220941f14908dbfce6f Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Sun, 28 Jun 2015 20:09:38 -0600 Subject: [PATCH] benchmarks/*: remove Benchmarks should be shaped as unittests and run as part of CI. --- benchmarks/all.py | 18 ------------------ benchmarks/ddb.pyon | 28 ---------------------------- benchmarks/pdb.pyon | 1 - benchmarks/pulse_rate.py | 26 -------------------------- benchmarks/rpc_timing.py | 32 -------------------------------- benchmarks/rtio_skew.py | 29 ----------------------------- 6 files changed, 134 deletions(-) delete mode 100644 benchmarks/all.py delete mode 100644 benchmarks/ddb.pyon delete mode 100644 benchmarks/pdb.pyon delete mode 100644 benchmarks/pulse_rate.py delete mode 100644 benchmarks/rpc_timing.py delete mode 100644 benchmarks/rtio_skew.py diff --git a/benchmarks/all.py b/benchmarks/all.py deleted file mode 100644 index d0a34263b..000000000 --- a/benchmarks/all.py +++ /dev/null @@ -1,18 +0,0 @@ -from artiq import * - -import pulse_rate, rtio_skew, rpc_timing - - -_exps = [pulse_rate.PulseRate, rtio_skew.RTIOSkew, rpc_timing.RPCTiming] - -class AllBenchmarks(Experiment, AutoDB): - """All benchmarks""" - - def build(self): - self.se = [] - for exp in _exps: - self.se.append(exp(self.dbh)) - - def run(self): - for se in self.se: - se.run() diff --git a/benchmarks/ddb.pyon b/benchmarks/ddb.pyon deleted file mode 100644 index 8dd20362c..000000000 --- a/benchmarks/ddb.pyon +++ /dev/null @@ -1,28 +0,0 @@ -{ - "comm": { - "type": "local", - "module": "artiq.coredevice.comm_tcp", - "class": "Comm", - "arguments": {"host": "192.168.0.42"} - }, - "core": { - "type": "local", - "module": "artiq.coredevice.core", - "class": "Core", - "arguments": {} - }, - - "pmt0": { - "type": "local", - "module": "artiq.coredevice.ttl", - "class": "TTLInOut", - "arguments": {"channel": 0} - }, - - "ttl0": { - "type": "local", - "module": "artiq.coredevice.ttl", - "class": "TTLOut", - "arguments": {"channel": 2} - }, -} diff --git a/benchmarks/pdb.pyon b/benchmarks/pdb.pyon deleted file mode 100644 index 0967ef424..000000000 --- a/benchmarks/pdb.pyon +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/benchmarks/pulse_rate.py b/benchmarks/pulse_rate.py deleted file mode 100644 index 4de78fa06..000000000 --- a/benchmarks/pulse_rate.py +++ /dev/null @@ -1,26 +0,0 @@ -from artiq import * -from artiq.coredevice.runtime_exceptions import RTIOUnderflow - - -class PulseRate(Experiment, AutoDB): - """Sustained pulse rate""" - - class DBKeys: - core = Device() - ttl0 = Device() - pulse_rate = Result() - - @kernel - def run(self): - T = time_to_cycles(100*ns) - while True: - try: - for i in range(1000): - self.ttl0.pulse(cycles_to_time(T)) - delay(cycles_to_time(T)) - except RTIOUnderflow: - T += 1 - self.core.break_realtime() - else: - self.pulse_rate = cycles_to_time(2*T) - break diff --git a/benchmarks/rpc_timing.py b/benchmarks/rpc_timing.py deleted file mode 100644 index 33e8152d9..000000000 --- a/benchmarks/rpc_timing.py +++ /dev/null @@ -1,32 +0,0 @@ -from math import sqrt - -from artiq import * - - -class RPCTiming(Experiment, AutoDB): - """RPC timing""" - - class DBKeys: - core = Device() - repeats = Argument(100) - rpc_time_mean = Result() - rpc_time_stddev = Result() - - def nop(self, x): - pass - - @kernel - def bench(self): - self.ts = [0.0 for _ in range(self.repeats)] - for i in range(self.repeats): - t1 = self.core.get_rtio_time() - self.nop(10) - t2 = self.core.get_rtio_time() - self.ts[i] = t2 - t1 - - def run(self): - self.bench() - mean = sum(self.ts)/self.repeats - self.rpc_time_stddev = sqrt( - sum([(t - mean)**2 for t in self.ts])/self.repeats)*s - self.rpc_time_mean = mean*s diff --git a/benchmarks/rtio_skew.py b/benchmarks/rtio_skew.py deleted file mode 100644 index a5770864b..000000000 --- a/benchmarks/rtio_skew.py +++ /dev/null @@ -1,29 +0,0 @@ -from artiq import * - - -class PulseNotReceived(Exception): - pass - - -class RTIOSkew(Experiment, AutoDB): - """RTIO skew""" - - class DBKeys: - core = Device() - pmt0 = Device() - rtio_skew = Result() - - @kernel - def run(self): - self.pmt0.output() - delay(1*us) - with parallel: - self.pmt0.gate_rising(10*us) - with sequential: - delay(5*us) - out_t = now() - self.pmt0.pulse(5*us) - in_t = self.pmt0.timestamp() - if in_t < 0*s: - raise PulseNotReceived - self.rtio_skew = out_t - in_t