def RandomNumpyVector(N): v = NumpyVector(N) if COMM_WORLD.rank == 0: v[:] = _rand(N) COMM_WORLD.Bcast(v.content, root=0) return v
def RandomNumpyMatrix(N, M): m = NumpyMatrix(N, M) if COMM_WORLD.rank == 0: m[:, :] = _rand(N, M) COMM_WORLD.Bcast(m.content, root=0) return m