It doesn't look like you are allocating the matrix on the slave processes...
If that is the case, try this for all ranks:
// Allocate all matrices and initialize their variables
assign_matrix(A,B); //initailise the matercies A & B
// Broadcast the array
for (i=0;i<=N-1;i++)
MPI::COMM_WORLD.Bcast(B[i],N,MPI::FLOAT,master);
|