
On 19 Oct 2010, at 17:39, Jack Bryan wrote:
thanks
I have two problems so that I cannot use boost.MPI.
Neither is a problem, as you'll see below.
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.
Boost.MPI has been designed to deal with this. Look at the skeleton&content mechanism. If you're sending the same datastructure many times there will be no cost beyond the first send. See also Dave's nice article here: http://daveabrahams.com/2010/09/03/whats-so-cool-about-boost-mpi/
Does boost.MPI support dynamic-size vector Serialization ?
Yes, definitely. It was designed for that and I doubt that you will see any performance penalty compared to a hand-written solution.
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 ?
Yes, it does. Matthias