def bcast(self, data): if MPI_INSTALLED: mpi_comm = MPI.COMM_WORLD bdata = mpi_comm.bcast(data, root=0) else: bdata = data return bdata # Wrapper for common MPI interfaces.