Dear Francis,
On 19 May 2016, at 14:54, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
...
File "qg3d_jet.py", line 38, in <module> q0.dat.data[:] += 0.01*Uj*np.random.randn(*q0.dat.shape) ValueError: operands could not be broadcast together with shapes (500000,) (520000,) (500000,) Traceback (most recent call last): File "qg3d_jet.py", line 38, in <module> q0.dat.data[:] += 0.01*Uj*np.random.randn(*q0.dat.shape) ValueError: operands could not be broadcast together with shapes (500000,) (520000,) (500000,)
Please use: V = q0.function_space() np.random.randn(V.dof_dset.size, *V.shape) The reason you have a failure in parallel is that q0.dat.shape includes the shape of the ghost/halo regions whereas q0.dat.data is only the "local" values (excluding halo regions). Obviously in serial the ghost region does not exist. Lawrence