From 0c76d9507979d0d5696d4954c94378fff948e2ef Mon Sep 17 00:00:00 2001 From: Manuel Gunther <siebenkopf@googlemail.com> Date: Wed, 25 Nov 2015 09:54:20 -0700 Subject: [PATCH] Added --parallel command line option to the bin/verify.py script (and all derived scripts). --- bob/bio/base/tools/algorithm.py | 2 +- bob/bio/base/tools/command_line.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bob/bio/base/tools/algorithm.py b/bob/bio/base/tools/algorithm.py index a819c06f..6fdaf318 100644 --- a/bob/bio/base/tools/algorithm.py +++ b/bob/bio/base/tools/algorithm.py @@ -165,7 +165,7 @@ def train_enroller(algorithm, extractor, force = False): train_features = read_features(train_files, reader, True) # perform training - logger.info("- Enrollment: training enroller '%s' using %d identities: ", fs.enroller_file, len(train_features)) + logger.info("- Enrollment: training enroller '%s' using %d identities", fs.enroller_file, len(train_features)) algorithm.train_enroller(train_features, fs.enroller_file) diff --git a/bob/bio/base/tools/command_line.py b/bob/bio/base/tools/command_line.py index 67647926..1f817ef2 100644 --- a/bob/bio/base/tools/command_line.py +++ b/bob/bio/base/tools/command_line.py @@ -131,6 +131,8 @@ def command_line_parser(description=__doc__, exclude_resources_from=[]): help = 'Performs score calibration after the scores are computed.') flag_group.add_argument('-z', '--zt-norm', action='store_true', help = 'Enable the computation of ZT norms') + flag_group.add_argument('-r', '--parallel', type=int, + help = 'This flag is a shortcut for running the commands on the local machine with the given amount of parallel threads; equivalent to --grid bob.bio.base.grid.Grid("local", number_of_parallel_threads=X) --run-local-scheduler --stop-on-failure.') return { 'main' : parser, @@ -191,6 +193,11 @@ def initialize(parsers, command_line_parameters = None, skips = []): if skip not in args.execute_only: exec("args.skip_%s = True" % (skip.replace("-", "_"))) + if args.parallel is not None: + args.grid = ['bob.bio.base.grid.Grid("local", number_of_parallel_processes = %d)' % args.parallel] + args.run_local_scheduler = True + args.stop_on_failure = True + # logging bob.core.log.set_verbosity_level(logger, args.verbose) -- GitLab