Skip to content

Commit

Permalink
Forces 'exe' passed to API to be split internally if it is a string (…
Browse files Browse the repository at this point in the history
…ie, it wasn't parsed by argparse)
  • Loading branch information
mpbelhorn committed Jun 21, 2016
1 parent 067b82c commit 755930e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
*.OU
*.o[0-9]*
*.pyc
*.dat
4 changes: 3 additions & 1 deletion python/wraprun/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def add_task(self, string=None, **kwargs):
EXAMPLES:
add_task('-n 1,2,3 --w-cd ./a,./b,./c ./exe exe_arg')
add_task(pes=[1,2,3], cd=['./a','./b','./c'] ,exe='./exe exe_arg')
add_task(pes=[1,2,3], cd=['./a','./b','./c'], exe='./exe exe_arg')
kwargs [kwarg (type): Description]:
cd (str or [str,...]): Task working directory
Expand All @@ -165,6 +165,8 @@ def add_task(self, string=None, **kwargs):
kwargs.update(
{"first_" + k: v for k, v in self._rank_and_color.items()})
self._parser.update(kwargs, string)
if hasattr(kwargs['exe'], 'split'):
kwargs['exe'] = kwargs['exe'].split()
task_group = TaskGroup(**kwargs)
self._rank_and_color = {
k: v + 1 for k, v in task_group.last_rank_and_color().items()}
Expand Down

0 comments on commit 755930e

Please sign in to comment.