diff --git a/bob/bio/base/tools/command_line.py b/bob/bio/base/tools/command_line.py index d584083abbfd28691adbd4333e16316fc7f68cd4..e48fae287cc3819fb0f5be8f1d310457befb48de 100644 --- a/bob/bio/base/tools/command_line.py +++ b/bob/bio/base/tools/command_line.py @@ -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('-t', '--environment', dest='env', nargs='*', default=[], help='Passes specific environment variables to the job.') return { 'main' : parser, diff --git a/bob/bio/base/tools/grid.py b/bob/bio/base/tools/grid.py index 05cde15cb96ccc8f16b0131511d6da08502bead3..cb04d88a12530adae3e7aad7fb9d458583097245 100644 --- a/bob/bio/base/tools/grid.py +++ b/bob/bio/base/tools/grid.py @@ -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,