Hi, I want to send a vector of data (i.e. vector<int> data) to another
processor. The sender knows the size of the vector but the receiver
does not . The question is how to have the receiver receives the data
? Thanks in advance,
For example
//global code
vector<int> data; //unknown size
if (taskID == Sender){
data.push_back(1);
data.push_back(2);
MPI_Send(&data[0],data.size(),MPI_INT .... ); // send
}
if (taskId == Receiver){
// QUESTION here -> how to receive the sending data ? the receiver
has no knowledge of the data size
}
tvn,
ThanhVu H. Nguyen
|