Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Object Send Doubt
From: Carlos Henrique da Silva Santos (santos.chs_at_[hidden])
Date: 2008-07-13 07:10:45


Ok. Gabriele,
   But I would like to know, how can I define DATATYPE on send and
recv? Could you give me an example?
   For example, my class has the following design and I want to
send/recv Test object.

class Test {
private:
     int coordinate;
     vector<double> s;
public:
      void setD(int, vector<double>);
      double getParameter(int);
      vector<double> getAll(void);
}

Thank you for all.

On Sun, Jul 13, 2008 at 6:33 AM, Gabriele Fatigati <g.fatigati_at_[hidden]> wrote:
> Hi Carlos,
> simply you can send all object's field and rebuild new object in destination
> process. Maybe, you have to delete old object in source process. Remember
> that you can't send address (eg: pointers) because they refera in local
> memory. If you want to do "deep copy" of object, you have to send the entire
> structures pointed to.
>
> 2008/7/13 Carlos Henrique da Silva Santos <santos.chs_at_[hidden]>:
>>
>> Mr. Andreas,
>> (English) I tried to apply MPI_Type_create_struct(), which is
>> correct for C Struct, as showed
>>
>> (https://hec.wiki.leeds.ac.uk/pub/Techniques/ParallelComputing/MPI_course.pdf).
>> But, I can't solve it for C++ object.
>>
>> (Portuguese) Eu tentei aplicar MPI_Type_create_struct(), que
>> funcionou em Struct do C, como mostrado em
>>
>> (https://hec.wiki.leeds.ac.uk/pub/Techniques/ParallelComputing/MPI_course.pdf).
>> Mas eu não consegui resolvê-lo para objetos em C++.
>>
>> Thank you,
>> Grato,
>>
>> Carlos
>>
>> _______________________________________________
>> users mailing list
>> users_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/users
>>
>
>
>
> --
> Gabriele Fatigati
>
> CINECA Systems & Tecnologies Department
>
> Supercomputing Group
>
> Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
>
> www.cineca.it Tel: +39 051 6171722
>
> g.fatigati_at_[hidden]
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>

-- 
==================================================
Carlos Henrique da Silva Santos, M.Sc.
Graduate Research Assistant
Laboratory of Electromagnetism Applied and Computational
Department of Microwaves and Optics
School of Electrical and Computer Engineer
State University of Campinas (UNICAMP)
Phone: +55(19)3521-5175
==================================================