LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Luis Miguel De la Cruz Salas(MCC) (lmd_at_[hidden])
Date: 2005-05-20 10:46:58


Hi,

As far as I know, it is not possible to send objects in MPI,
maybe OOMPI (http://www.osl.iu.edu/research/oompi/) can help,
someone knows if this is an alive developing project?

On the other hand, you can send the size and the vector<int>
separately:

> //global code
>
> vector<int> data; //unknown size
>
> if (taskID == Sender){
> data.push_back(1);
> data.push_back(2);

 int size = data.size();
 MPI_Send(&size,1,MPI_INT ....);
 MPI_Send(&data[0],size,MPI_INT .... ); // send

>
> MPI_Send(&data[0],data.size(),MPI_INT .... ); // send
> }
> if (taskId == Receiver){

Here, first you must receive size and then data.

> // QUESTION here -> how to receive the sending data ? the receiver
> has no knowledge of the data size
> }
>
> tvn,
>
> ThanhVu H. Nguyen
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>

I hope this helps
                                  .--.
  Luis M. de la Cruz S. |o_o | PhD. Candidate, IIMAS, UNAM
  Cómputo Aplicado, |:_/ | Linux User: 195159
  DGSCA, UNAM, México // \ \
  Tel. 562-26774 (| | ) ¡L'art c'est l'azur!
  http://www.mcc.unam.mx/~lmd /'\_ _/`\ Victor Hugo
                              \___)=(___/