Commit 8ab1612d authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Solving issue #14 and added the argument --environment

parent fc1077f6
......@@ -139,6 +139,8 @@ def command_line_parser(description=__doc__, exclude_resources_from=[]):
help = "If given, missing files will not stop the processing; this is helpful if not all files of the database can be processed; missing scores will be NaN.")
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.')
flag_group.add_argument('-s', '--environment', dest='env', nargs='*', default=[], help='Passes specific environment variables to the job.')
return {
'main' : parser,
......
......@@ -49,6 +49,8 @@ class GridSubmission:
if args.grid is not None:
assert isinstance(args.grid, grid.Grid)
self.env = args.env #Fetching the enviroment variable
# find, where jman is installed
jmans = bob.extension.find_executable('jman', prefixes = ['bin'])
......@@ -93,6 +95,9 @@ class GridSubmission:
# submit the job to the job manager
if not self.args.dry_run:
if(self.env is not None):
kwargs['env'] = self.env
job_id = self.job_manager.submit(
command_line = cmd,
name = name,
......
Supports Markdown
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