Actually the answer is yes. This is exactly what is done by Boost.MPI!

When you send an object using Boost.MPI, it is serialized into an MPI buffer by the packed_oarchive. Then that buffer's content is sent via MPI and it is unpacked at the other end. All this is transparently done by the send and recv calls of Boost.MPI.

Matthias, so is possible to create this packed_oarchive for sender process, and packed_oarchive for receiver process and use plain MPI instructions MPI_send MPI_recv.

i think im getting the idea, i just need an example i could look at and understand the silly parts to connect everything
thanks for all the help really

 

> Feel free to contribute one.

No need since it already exists.

>
> If I had nothing else to do, I would
>
> a) make a stream_buf which uses MPI

> b) use binary_iarchive and binary_oarchive with this new stream_buf

we avoid streambufs by directly packing using detail::mpi_[io]primitive. This allows us to make use of conversion facilities in MPI, rather than packing as native binary.

> c) open one program with binary_oarchive and the other with binary_iarchive

we call them packed_oarchive and packed_iarchive

> d) do ar << on one end and ar >> at the other

That is what the send and recv functions do, but in addition we have the MPI_Send and MPI_Recv calls that transfer the buffer.

Matthias


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