Skip to content

Commit

Permalink
Merge pull request #314 from marrink-lab/feature/command-limit
Browse files Browse the repository at this point in the history
Limit the line length for the command in the top
  • Loading branch information
pckroon committed Sep 30, 2020
2 parents c677535 + f335520 commit c5f3980
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/martinize2
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,17 @@ def entry():
LOGGER.debug("Writing molecule {}.", molecule, type='step')

# Write the topology if requested
# grompp has a limit in the number of character it can read per line
# (due to the size limit of a buffer somewhere in its implementation).
# The command line can be longer than this limit and therefore
# prevent grompp from reading the topology.
gromacs_char_limit = 4000 # the limit is actually 4095, but I play safe
command = ' '.join(sys.argv)
if len(command) > gromacs_char_limit:
command = command[:gromacs_char_limit] + ' ...'
header = [
'This file was generated using the following command:',
' '.join(sys.argv),
command,
VERSION,
]
if None not in ss_sequence:
Expand Down

0 comments on commit c5f3980

Please sign in to comment.