LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: ThanhVu Nguyen (tvn_email-debianml_at_[hidden])
Date: 2005-05-19 14:32:02


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