Skip to content

Commit

Permalink
Add -q to parallel. This issue is explained in https://stackoverflow.…
Browse files Browse the repository at this point in the history
…com/questions/8230074/how-to-pass-quoted-args-to-gnu-parallel , which links to : https://www.gnu.org/software/parallel/man.html#QUOTING.

After this fix, #305 should be resolved.

PiperOrigin-RevId: 317875659
  • Loading branch information
pichuan authored and copybara-github committed Jun 23, 2020
1 parent a69fcd7 commit fbacd35
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/run_deepvariant.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,16 @@
}


def _is_quoted(value):
if value.startswith('"') and value.endswith('"'):
return True
if value.startswith("'") and value.endswith("'"):
return True
return False


def _add_quotes(value):
if isinstance(value, str) and value.startswith('"') and value.endswith('"'):
if isinstance(value, str) and _is_quoted(value):
return value
return '"{}"'.format(value)

Expand Down Expand Up @@ -172,7 +180,7 @@ def make_examples_command(ref, reads, examples, extra_args, **kwargs):
"""
command = [
'time', 'seq 0 {} |'.format(FLAGS.num_shards - 1),
'parallel --halt 2 --line-buffer', '/opt/deepvariant/bin/make_examples'
'parallel -q --halt 2 --line-buffer', '/opt/deepvariant/bin/make_examples'
]
command.extend(['--mode', 'calling'])
command.extend(['--ref', '"{}"'.format(ref)])
Expand Down

0 comments on commit fbacd35

Please sign in to comment.