I am using boost-mpi and I am getting an error that I am having a hard time figuring out. I am using a recv call and an assertion in the boost code fails:
void boost::mpi::binary_buffer_iprimitive::load_impl(void *, int): Assertion `position+l<=static_cast<int>(buffer_.size())’
This is from the file binary_buffer_iprimitive.hpp located in boost/mpi/detail/.
This does not occur the first time I am receiving so I know it’s not a general error with every send/recv call I make. I think this assertion is checking whether the buffer is large enough to accommodate the data being received, but I’m not even sure about that. If that is the case, what could cause the buffer to not be large enough? Shouldn’t that be taken care of by the underlying boost?
for (unsigned int i=0;i<world.size();i++)
{
if (particles_to_be_sent[i].size()>0)
{
ghosts_to_be_sent[i].part_crossed_send()='b';
world.isend(i,20,particles_to_be_sent[i]);
}
}
mpi::all_to_all(world,ghosts_to_be_sent,ghosts_received);
//receive particles
for (int recv_rank=0;recv_rank<world.size();recv_rank++)
{
if (ghosts_received[recv_rank].part_crossed_send()=='b')
{
world.recv(recv_rank,20,particles_received); //this line fails
for (unsigned int i=0;i<particles_received.size();i++)
{
//do stuff
}
}
for (unsigned int j=0;j<ghosts_received[recv_rank].ghosts_to_send().size();j++)
{
//do stuff
}
}