I have a matrix (c) of 10x10 (M = 10) elements in which I divide the matrix by rows so that they are executed by 5 different processes (slaves = 5), so that each process corresponds to 2 rows of that matrix.
offset = 0;
filas = (M / esclavos);
MPI_Send(&c[offset][0], filas*M, MPI_DOUBLE, id_esclavo,0,MPI_COMM_WORLD);
offset= offset+filas;
Now I want to divide the matrix but by columns. Try changing the indexes of the matrix as follows but it does not work:
MPI_Send(&c[0][offset], filas*M, MPI_DOUBLE, id_esclavo,0,MPI_COMM_WORLD);
Do you know how to do it? Thanks