Hi Carlos, but why you need to pass an object? I don't understand this. Usuall, in MPI, we don't need to do this.
2008/7/13 Andreas Schäfer <gent...@gmx.de>: > On 08:10 Sun 13 Jul , Carlos Henrique da Silva Santos wrote: > > 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); > > } > > Hi Carlos, > > the problem with this object is that it contains a pointer to malloc'd > memory (the vector). Since datatypes can only be used for objects with > fixed size (and layout), you can't define an MPI_Datatype for > this. I'd suggest you to use Boost.MPI in this case > (http://www.boost.org/doc/libs/1_35_0/doc/html/mpi.html) > > Cheers > -Andreas > > > -- > ============================================ > Andreas Schäfer > Cluster and Metacomputing Working Group > Friedrich-Schiller-Universität Jena, Germany > 0049/3641-9-46376 > PGP/GPG key via keyserver > I'm a bright... http://www.the-brights.net > ============================================ > > (\___/) > (+'.'+) > (")_(") > This is Bunny. Copy and paste Bunny into your > signature to help him gain world domination! > > _______________________________________________ > users mailing list > us...@open-mpi.org > 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.fatig...@cineca.it