Dear Francis,

On 26 Apr 2016, at 02:38, Francis Poulin <fpoulin@uwaterloo.ca> wrote:

q0.dat.data[:] += 0.01*np.random.randn(*q0.dat.shape)

However, when I try running it using mpirun on my mac it fails because the declaration of a random variable is not broadcast.

: operands could not be broadcast together with shapes (2500,) (2724,) (2500,) 

ValueError: operands could not be broadcast together with shapes (2500,) (2908,) (2500,) 


This occurs because the shape includes the ghost or halo region of the data, whereas the left hand side array is only the local portion. Please try using:

q0.dof_dset.size

For the number of values. 

We should probably document this kind of stuff more clearly. If you have any comments feel free to add them here: https://github.com/firedrakeproject/firedrake/issues/761

Thanks,

Lawrence