thanks

I have two problems so that I cannot use boost.MPI. 

I need to transfer data very frequently, and calling boost Serialization will increase overhead by system call. 
   
    Because every time I call mpi_send, the Serialization() needs to be called. 

   This will reduce bandwith on MPI systems.

Does boost.MPI support dynamic-size vector Serialization ? 

For example, 

I declare a 

class myDataS {

double data1;
vector<double> dataVec; 

} myData;

This class is visible to all processors. 

In processor 1, I initialize  dataVec(mysize); // mysize is not visible to other processors except processor 1. 


I use world.send() to send myData to processor 2 by Serialization() in the class myDataS .

Does the processor2 knows that how large the dataVec is ? and in processor2, in world.recv(), 
if I use myData to receive the data from processor 1, how to make sure that all elements in the vector have been received ? 


Any help is appreciated. 

Jack

Oct. 19 2010



From: troyer@phys.ethz.ch
Date: Tue, 19 Oct 2010 17:12:33 -0700
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] boost.MPI dynamic data structure error


On 19 Oct 2010, at 13:39, Jack Bryan wrote:

Hi , 

I need to design a data structure to transfer data between nodes by boost.MPI. 

Some elements of the the structure has dynamic size. 

For example, 

typedef struct{

double data1;
vector<double> dataVec; 

} myDataType;

The size of the dataVec depends on some intermidiate computing results.

If I only declear it as the above myDataType, I think, only a pointer is transfered. 

When the data receiver try to access the elements of vector<double> dataVec, it got 
segentation fault error.

But, I also need to use the myDataType to declear other data structures. 

such as vector<myDataType> newDataVec;

Hi Jack,

All you need to do is to define a serialize() function for your data structure, so that it can be serialized by Boost.Serialization. Then you can transfer the datastructure with Boost.MPI

Matthias



_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users