Bug #1772

trjconv doesn't display stdout properly during conversion

Added by James Barnett over 5 years ago. Updated over 4 years ago.

Target version:
Affected version - extra info:
Affected version:



I run a 100 ns simulation saving a frame every 1 ps, so I have 100,000 frames. I convert the file to a new trajectory with 50,000 frames (so every 2ps):

gmx trjconv -f prd.xtc -dt 2 -o out.xtc

During the conversion this is displayed for example (the number obviously updates) with lots of flickering throughout the entire conversion process (until the end where it is displayed properly):

->  frame    490 time  980.000        ->  frame    450 time  900.000

Other times I run it, it shows up properly throughout the entire run:

Reading frame    1000 time 1000.000    ->  frame    500 time 1000.000

Associated revisions

Revision 85d59d17 (diff)
Added by Erik Lindahl over 4 years ago

Flush streams when not writing newline character

Some of our routines use the carriage return without a newline
to keep writing the status e.g. on stderr.
For some operating systems this seems to lead to the output
being cached in the buffers, so this change adds an explicit
fflush() for these print stamements.

Fixed #1772.

Change-Id: I3ad9c4f0e962d8a0b2f8d2341af69f0e3d01a477


#1 Updated by Erik Lindahl over 5 years ago

It's likely the OS buffering stdout/stderr, which might make the behavior dependent on the current load on the system (or whatever other OS properties). Not sure we can fix it in Gromacs since we also depend on staying on a single line (i.e., no line feeds), and that might not go well with flushing the streams.

#2 Updated by Gerrit Code Review Bot over 4 years ago

Gerrit received a related patchset '1' for Issue #1772.
Uploader: Erik Lindahl ()
Change-Id: I3ad9c4f0e962d8a0b2f8d2341af69f0e3d01a477
Gerrit URL:

#3 Updated by Erik Lindahl over 4 years ago

  • Status changed from New to Fix uploaded

#4 Updated by Erik Lindahl over 4 years ago

  • Status changed from Fix uploaded to Resolved

#5 Updated by Erik Lindahl over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF