Commit df292896 authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

add option nworkers

parent 05d3ee16
......@@ -256,6 +256,10 @@ def command_scan(args):
help='end of processing time window '
'(overrides config file settings)')
parser.add_option(
'--nworkers', dest='nworkers', metavar="N",
help='use N cpus in parallel')
parser, options, args = cl_parse('scan', args, setup=setup)
if len(args) != 1:
help_and_die(parser, 'missing argument')
......@@ -271,6 +275,11 @@ def command_scan(args):
if options.tmax:
tmax = str_to_time(options.tmax)
if options.nworkers:
nparallel = int(options.nworkers)
else:
nparallel = None
lassie.scan(
config,
override_tmin=tmin,
......@@ -278,7 +287,8 @@ def command_scan(args):
force=options.force,
show_detections=options.show_detections,
show_movie=options.show_movie,
stop_after_first=options.stop_after_first)
stop_after_first=options.stop_after_first,
nparallel=nparallel)
except lassie.LassieError, e:
die(str(e))
......
......@@ -48,7 +48,8 @@ def scan(
show_detections=False,
show_movie=False,
force=False,
stop_after_first=False):
stop_after_first=False,
nparallel=None):
if config.detections_path:
if op.exists(config.detections_path):
......@@ -180,6 +181,7 @@ def scan(
offsetout=iwmin,
lengthout=lengthout,
result=frames,
nparallel=nparallel,
impl='openmp')
shift_max = max(shift_maxs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment