From 4b0382cadd10132f55e98fda4a5e7f710d5dbdf6 Mon Sep 17 00:00:00 2001
From: Richard Berger <richard.berger@temple.edu>
Date: Tue, 21 Aug 2018 14:45:01 -0400
Subject: [PATCH] Fixes issue #1069

---
 python/lammps.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/python/lammps.py b/python/lammps.py
index 2f4ffb642e..598e4c506f 100644
--- a/python/lammps.py
+++ b/python/lammps.py
@@ -173,6 +173,9 @@ class lammps(object):
         self.lib.lammps_open(narg,cargs,comm_val,byref(self.lmp))
 
       else:
+        if lammps.has_mpi4py:
+          from mpi4py import MPI
+          self.comm = MPI.COMM_WORLD
         self.opened = 1
         if cmdargs:
           cmdargs.insert(0,"lammps.py")
@@ -862,6 +865,10 @@ class PyLammps(object):
 
   def run(self, *args, **kwargs):
     output = self.__getattr__('run')(*args, **kwargs)
+
+    if(lammps.has_mpi4py):
+      output = self.lmp.comm.bcast(output, root=0) 
+    
     self.runs += get_thermo_data(output)
     return output
 
-- 
GitLab