A: 

There's a few issues here, but the thing which is causing the crash is almost certainly the first argument to MPI_Bcast and MPI_Gather.

In C, using the name of an array is the same as a pointer to the start of the array -- eg, a pointer to the buffer that you want to send. So you just need to pass back_ray and myray, not &back_ray and &myray, which are then pointers to pointers.

Note too that the broadcast and the gather each iteration are way overkill for this problem -- no processor needs that much information to proceed, timestep to timestep.

Jonathan Dursi