From: Brian Barrett (brbarret_at_[hidden])
Date: 2005-11-13 09:16:42

On Nov 13, 2005, at 1:34 AM, Yaron Kretchmer wrote:

> I have an mpi-based application which contains an STL map. The map
> is of a non-standard type (i.e my own class). I would like to
> synchronize the maps between multiple machines , at the end of
> which I want each machine to have the complete map. This seems to
> be a pretty standard operation, so I'm wondering if it's been done
> before. If not, some pointers on how to roll my own sync would be
> appreciated

If you use straight MPI, you are going to have to write your own
datatype information, and probably some packing / unpacking code.
MPI doesn't map very well to some of the complex STL datatypes (like
std::map), so some translation will be necessary. In terms of
actually moving the data, I believe MPI_ALLGATHERV will do what you
wish, but it's going to take some setup work to get the data ready
for transmission.

I'm not aware of any packages that make using the STL and MPI easier,
but it's possible I've missed them.


   Brian Barrett
   Graduate Student, Open Systems Lab, Indiana University