I want to send the vector<vector<int>> vec from processor 1 to processor 2.
Let say the vec {{1,2,4},{2,3,5},{3,4,6},{4,5,2},{3,4,6}}.
I send the vec like this
MPI_Send(&vec[0], Vector_size, MPI_INT, i_proc, 0, MPI_COMM_WORLD);
and receive in processor 2 like this
1 2
|
vector<vector<int>> vec;
MPI_Recv(&vec[0], Vector_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
| |
everytime I run this code I get weird error. "microsoft visual studion run time library, assertation failed and vector subscript out of range "
also I tried this one but no difference.
MPI_Send(&vec[0][0], Vector_size, MPI_INT, i_proc, 0, MPI_COMM_WORLD);
and receive in processor 2 like this
1 2
|
vector<vector<int>> vec;
MPI_Recv(&vec[0][0], Vector_size, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
| |