Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4558fb3e3381
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4c015d383d28
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Feb 17, 2015

  1. Copy the full SHA
    614a96a View commit details
  2. Copy the full SHA
    656099a View commit details
  3. Copy the full SHA
    170a626 View commit details
  4. Copy the full SHA
    4c015d3 View commit details
Showing with 35 additions and 18 deletions.
  1. +3 −2 artiq/frontend/artiq_run.py
  2. +11 −1 artiq/tools.py
  3. +16 −0 benchmarks/all.py
  4. +3 −7 examples/pulse_performance.py → benchmarks/pulse_rate.py
  5. +2 −8 {examples → benchmarks}/rtio_skew.py
5 changes: 3 additions & 2 deletions artiq/frontend/artiq_run.py
Original file line number Diff line number Diff line change
@@ -123,8 +123,9 @@ def main():
else:
if rdb.data.read or rdb.realtime_data.read:
print("Results:")
for k, v in chain(rdb.realtime_data.read.items(),
rdb.data.read.items()):
for k, v in sorted(chain(rdb.realtime_data.read.items(),
rdb.data.read.items()),
key=itemgetter(0)):
print("{}: {}".format(k, v))
finally:
dbh.close()
12 changes: 11 additions & 1 deletion artiq/tools.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from operator import itemgetter
import sys
import importlib.machinery
import linecache
import logging
import os.path


def format_run_arguments(arguments):
@@ -26,8 +28,16 @@ def file_import(filename):
modname = modname[:i]
modname = "file_import_" + modname

path = os.path.dirname(os.path.realpath(filename))
sys.path.insert(0, path)

loader = importlib.machinery.SourceFileLoader(modname, filename)
return loader.load_module()
module = type(sys)(modname)
loader.exec_module(module)

sys.path.remove(path)

return module


def verbosity_args(parser):
16 changes: 16 additions & 0 deletions benchmarks/all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from artiq import *

import pulse_rate, rtio_skew


_units = [pulse_rate.PulseRate, rtio_skew.RTIOSkew]

class AllBenchmarks(AutoDB):
def build(self):
self.se = []
for unit in _units:
self.se.append(unit(self.dbh))

def run(self):
for se in self.se:
se.run()
10 changes: 3 additions & 7 deletions examples/pulse_performance.py → benchmarks/pulse_rate.py
Original file line number Diff line number Diff line change
@@ -2,13 +2,10 @@
from artiq.coredevice.runtime_exceptions import RTIOUnderflow


def print_min_period(p):
print("Minimum square wave output period: {} ns".format(p))


class PulsePerformance(AutoDB):
class PulseRate(AutoDB):
class DBKeys:
ttl0 = Device()
pulse_rate = Result()

@kernel
def run(self):
@@ -22,6 +19,5 @@ def run(self):
T += 1
self.core.recover_underflow()
else:
print_min_period(int(cycles_to_time(2*T)/(1*ns)))
self.pulse_rate = cycles_to_time(2*T)
break

10 changes: 2 additions & 8 deletions examples/rtio_skew.py → benchmarks/rtio_skew.py
Original file line number Diff line number Diff line change
@@ -9,13 +9,7 @@ class RTIOSkew(AutoDB):
class DBKeys:
pmt0 = Device()
ttl0 = Device()
io_skew = Result()

@staticmethod
def realtime_results():
return {
"io_skew": "raw"
}
rtio_skew = Result()

@kernel
def run(self):
@@ -28,4 +22,4 @@ def run(self):
in_t = self.pmt0.timestamp()
if in_t < 0*s:
raise PulseNotReceived
self.io_skew = out_t - in_t
self.rtio_skew = out_t - in_t