Boost logo

Boost-MPI :

Subject: Re: [Boost-mpi] mixing boost serialization with C MPI functions
From: Alain Miniussi (alain.miniussi_at_[hidden])
Date: 2015-11-19 10:48:42


Hi,

What makes you think the problem is with boost MPI ? the message only mention the C API.
  
Apparently the problem occurs during an intra node communication, and is likely to be related with the MPI configuration since I do not think that Boost.MPI directly allocate shared memory.

What version are you using ? does the boost/mpi/config.hpp file defines BOOST_MPI_HOMOGENEOUS ? (if not, that could increase the size of the messages).

That being said, the archive is supposed to handle its memory.

Cheers

Alain

On 19/11/2015 16:07, Jiaxin Han wrote:
> Hi,
>
> Could anyone point me to an example of mixing boost serialization with C MPI functions?
>
> I guess I need to use boost::mpi::oarchive. But how should I initialize the buffer parameter, and what should I pass to MPI_Send after that? More specifically, I am trying to do the following:
>
> typedef vector <int> ParticleList_t;
> #define MSG_LEN 100000
> ParticleList_t sendbuf(MSG_LEN, 1), recvbuf(MSG_LEN);
> mpi::packed_oarchive::buffer_type buffer(sizeof(sendbuf[0])*sendbuf.size());
> mpi::packed_oarchive oa(world, buffer, boost::archive::no_header);
> oa & sendbuf;
> if(world.rank()==0)
> MPI_Send(oa, 1, MPI_PACKED, 1, 0, MPI_COMM_WORLD);
>
> Do I have to make sure buffer is big enough or the oarchive will handle the memory automatically? If the former, what is the correct memory size to hold a vector? I guess it should hold not just vec.data(), but also vec.size().
>
> And lastly, oa does not appear to be the correct variable to pass to MPI_Send. Then what should I pass to MPI_Send after creating the archive?
>
>
> I am asking because the boost mpi installation on our server appears to have a limitation on the message size. For example, the attached code reports an error as:
>
> terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::mpi::exception> >'
> what(): MPI_Alloc_mem: MPI_Alloc_mem: Out of "special" (shared) memory
> MPI Application rank 0 killed before MPI_Finalize() with signal 6
>
> This appears to be a problem only with the boost installation on the server. The code runs correctly on my local machine.
>
> Many Thanks!
>
> Jiaxin
>
>
>
> _______________________________________________
> Boost-mpi mailing list
> Boost-mpi_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-mpi
>

-- 
---
Alain

Boost-Commit list run by troyer at boostpro.com