summaryrefslogtreecommitdiff
path: root/sim.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-08-10 00:21:15 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-08-10 00:21:15 -0400
commit23b4bedf43f2ff120c1178c3445e39b8735030f3 (patch)
tree739b7e72a9e4bbdb4c26bc1a010bd908d7f69ec4 /sim.py
parentea5cc8e4e0e9bd1d1a1e5e7140c0022a8bd2a59d (diff)
parent14eb2b598fc5c2f70f3f4692dc58f0206b07d728 (diff)
downloadchroma-23b4bedf43f2ff120c1178c3445e39b8735030f3.tar.gz
chroma-23b4bedf43f2ff120c1178c3445e39b8735030f3.tar.bz2
chroma-23b4bedf43f2ff120c1178c3445e39b8735030f3.zip
merge heads
Diffstat (limited to 'sim.py')
-rwxr-xr-xsim.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sim.py b/sim.py
index 0d775f4..34477f9 100755
--- a/sim.py
+++ b/sim.py
@@ -75,7 +75,13 @@ def write_event(T, ev, event_id, hits, photon_start=None, photon_stop=None):
root.fill_hits(ev, len(hits['t']), hits['t'], hits['q'], hits['history'])
T.Fill()
-#@profile
+# Allow profile decorator to exist, but do nothing if not running under kernprof
+try:
+ profile = profile
+except NameError:
+ profile = lambda x: x
+
+@profile
def main():
parser = optparse.OptionParser('%prog')
parser.add_option('-b', type='int', dest='nbits', default=10)