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: Andreas Schäfer (gentryx_at_[hidden])
Date: 2008-07-13 13:25:59

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


Andreas Schäfer
Cluster and Metacomputing Working Group
Friedrich-Schiller-Universität Jena, Germany
PGP/GPG key via keyserver
I'm a bright...
This is Bunny. Copy and paste Bunny into your 
signature to help him gain world domination!

  • application/pgp-signature attachment: stored