Add and use lammps_flush_buffers() in Python interface

This commit is contained in:
Richard Berger
2022-02-04 10:42:22 -05:00
parent 293d529ee9
commit 0ff3ee0227
2 changed files with 13 additions and 0 deletions

View File

@ -857,10 +857,12 @@ class PyLammps(object):
"""
def handler(*args, **kwargs):
cmd_args = [name] + [str(x) for x in args]
self.lmp.flush_buffers()
with OutputCapture() as capture:
cmd = ' '.join(cmd_args)
self.command(cmd)
self.lmp.flush_buffers()
output = capture.output
comm = self.lmp.get_mpi_comm()