Improve MPI support in PyLammps

This commit is contained in:
Richard Berger
2021-09-09 21:47:08 -04:00
parent 7b1e951916
commit d09851e695

View File

@ -508,11 +508,6 @@ class PyLammps(object):
:py:attr:`PyLammps.last_run`. :py:attr:`PyLammps.last_run`.
""" """
output = self.__getattr__('run')(*args, **kwargs) output = self.__getattr__('run')(*args, **kwargs)
comm = self.lmp.get_mpi_comm()
if comm:
output = self.lmp.comm.bcast(output, root=0)
self.runs += get_thermo_data(output) self.runs += get_thermo_data(output)
return output return output
@ -784,6 +779,10 @@ class PyLammps(object):
self.command(cmd) self.command(cmd)
output = capture.output output = capture.output
comm = self.lmp.get_mpi_comm()
if comm:
output = self.lmp.comm.bcast(output, root=0)
if 'verbose' in kwargs and kwargs['verbose']: if 'verbose' in kwargs and kwargs['verbose']:
print(output) print(output)