summaryrefslogtreecommitdiff
path: root/threadtest.py
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-06-21 15:47:54 -0400
committerStan Seibert <stan@mtrr.org>2011-06-21 15:47:54 -0400
commit81c4bf14e0357b597570dbb551a37c54cc1806de (patch)
tree4ed69854c28efd1dad383b39e14c73bec5dc8ed4 /threadtest.py
parentdc3b5bbf2cb52ae9d0fe2dc5583c29bfdf1b419f (diff)
downloadchroma-81c4bf14e0357b597570dbb551a37c54cc1806de.tar.gz
chroma-81c4bf14e0357b597570dbb551a37c54cc1806de.tar.bz2
chroma-81c4bf14e0357b597570dbb551a37c54cc1806de.zip
Set a detector object variable near the top of the main function in
threadtest.py to make it easier to flip between different models.
Diffstat (limited to 'threadtest.py')
-rw-r--r--threadtest.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/threadtest.py b/threadtest.py
index 681b019..d76224f 100644
--- a/threadtest.py
+++ b/threadtest.py
@@ -75,23 +75,25 @@ if __name__ == '__main__':
parser.add_option('-n', type='int', dest='nblocks', default=64)
options, args = parser.parse_args()
- from detectors import minilbne
+ from detectors import lbne_cut, minilbne_cut, minilbne, microlbne
- minilbne.build(bits=options.nbits)
+ detector = minilbne_cut
+
+ detector.build(bits=options.nbits)
cuda.init()
gputhreads = []
for i in range(options.ndevices):
- gputhreads.append(GPUThread(i, minilbne, jobs, output, options.nblocks))
+ gputhreads.append(GPUThread(i, detector, jobs, output, options.nblocks))
gputhreads[-1].start()
try:
- event_times = generate_event(minilbne)
+ event_times = generate_event(detector)
for z in np.linspace(-1.0, 1.0, 100):
t0 = time.time()
- log_likelihood = likelihood(minilbne, event_times, (z,0,0))
+ log_likelihood = likelihood(detector, event_times, (z,0,0))
elapsed = time.time() - t0
print 'z = %5.2f, likelihood = %s, elapsed %.2f sec' % (z, log_likelihood, elapsed)
finally: