I can send the row of a matrix, and the column of another matrix in a single MPI_SEND, how can I do this procedure?
MPI_SEND (row and column of the matrix ...)
I can send the row of a matrix, and the column of another matrix in a single MPI_SEND, how can I do this procedure?
MPI_SEND (row and column of the matrix ...)
Since C/C++ works in row major order, you can either declare your 2D matrix in a 1D vector and access its entries by using a simple convention. Assuming A is of size mxn and B is a vector;
A[i][j] = B[i*n+j];
But if you are coding in C++, I would suggest defining a matrix object and try sending these objects in MPI. You would have to create your own MPI_Data_Type.