Parallel processing 使用MPI_Barrier()提高性能并避免缓冲区问题?

Parallel processing 使用MPI_Barrier()提高性能并避免缓冲区问题?,parallel-processing,mpi,boost-mpi,Parallel Processing,Mpi,Boost Mpi,我可以这样做来提高性能,避免在更高的迭代中遇到缓冲区问题吗。最大迭代次数=6000次 While(numberIterations<= MaxIterations) { MPI_Iprobe() -- check for incoming data while(flagprobe !=0) { MPI_Recv() -- receive data MPI_Iprobe() -- loop if more data } u

我可以这样做来提高性能,避免在更高的迭代中遇到缓冲区问题吗。最大迭代次数=6000次

While(numberIterations<= MaxIterations)
{
   MPI_Iprobe() -- check for incoming data
    while(flagprobe !=0)
    {
        MPI_Recv() -- receive data
        MPI_Iprobe() -- loop if more data
    }

   updateData() -- update myData

   for(i=0;i<N;i++) MPI_Isend(request[i]) -- send request

   for(i=0;i<N;i++) MPI_Wait(request[i]) --wait till request is complete

   if(numberIterations = MaxIterations) { MPI_Barrier() }

   numberIterations ++

}

While(numberiterations)Yes问题的可能重复项在同一行上。如果这是一种错误的做法,我正在尝试从MPI社区获得意见。代码中的N是什么?它是否等于MPI_Comm_size()?在继续更新数据()之前,您需要所有其他级别的数据吗?是的,N等于MPI_Comp_Size。是的,如果我能在其他所有RANKSHUPDATE之前收集数据,我会得到准确的结果。我现在正在做的所有其他RANKSHUPDATE,这似乎适用于更大的迭代