提升mpi断言失败

时间:2013-01-04 19:03:53

标签: mpi boost-mpi

我正在使用boost-mpi,我收到一个错误,我很难搞清楚。我正在使用recv调用并且升压代码中的断言失败:

void boost::mpi::binary_buffer_iprimitive::load_impl(void *, int): Assertion `position+l<=static_cast<int>(buffer_.size())’

这是来自boost / mpi / detail /的文件binary_buffer_iprimitive.hpp。

这在我第一次收到时不会发生,因此我知道每次发送/接收电话都不是一般错误。我认为这个断言正在检查缓冲区是否足够大以容纳正在接收的数据,但我甚至不确定。如果是这种情况,可能导致缓冲区不够大的原因是什么?不应该通过潜在的推动来解决这个问题吗?

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
        }
    }

0 个答案:

没有答案
相关问题