Browse Source

add option nworkers

plot3d
Marius Kriegerowski 5 years ago
parent
commit
df292896d3
  1. 12
      apps/lassie
  2. 4
      src/core.py

12
apps/lassie

@ -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))

4
src/core.py

@ -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)

Loading…
Cancel
Save