only try to broadcast if we have a proper communicator

This commit is contained in:
Axel Kohlmeyer
2020-09-18 21:17:31 -04:00
parent f5fda95da6
commit 897a7d0ed4

View File

@ -2206,7 +2206,8 @@ class PyLammps(object):
""" """
output = self.__getattr__('run')(*args, **kwargs) output = self.__getattr__('run')(*args, **kwargs)
if(self.has_mpi4py): comm = self.lmp.get_mpi_comm()
if comm:
output = self.lmp.comm.bcast(output, root=0) output = self.lmp.comm.bcast(output, root=0)
self.runs += get_thermo_data(output) self.runs += get_thermo_data(output)