Ejemplo n.º 1
0
bool Foam::OPstream::finishedRequest(const label i)
{
    if (i >= OPstream_outstandingRequests_.size())
    {
        FatalErrorIn
        (
            "OPstream::finishedRequest(const label)"
        )   << "There are " << OPstream_outstandingRequests_.size()
            << " outstanding send requests and you are asking for i=" << i
            << nl
            << "Maybe you are mixing blocking/non-blocking comms?"
            << Foam::abort(FatalError);
    }

    int flag;
    MPI_Test(&OPstream_outstandingRequests_[i], &flag, MPI_STATUS_IGNORE);

    return flag != 0;
}
Ejemplo n.º 2
0
void Foam::OPstream::waitRequests()
{
    if (OPstream_outstandingRequests_.size())
    {
        if
        (
            MPI_Waitall
            (
                OPstream_outstandingRequests_.size(),
                OPstream_outstandingRequests_.begin(),
                MPI_STATUSES_IGNORE
            )
        )
        {
            FatalErrorIn
            (
                "OPstream::waitRequests()"
            )   << "MPI_Waitall returned with error" << Foam::endl;
        }

        OPstream_outstandingRequests_.clear();
    }
}