Commit aa956f4b authored by mattijs's avatar mattijs
Browse files

ENH: Pstream: Feed through outstanding requests more. See #1626.

This e.g. was giving a problem with using volPointInterpolation (in
functionObjects) with non-blocking global reductions.
parent ff568aa6
......@@ -763,7 +763,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
)
{
label nReq = Pstream::nRequests();
const label nReq = Pstream::nRequests();
forAll(bfld, patchi)
{
......
......@@ -50,7 +50,7 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
)
{
label nReq = Pstream::nRequests();
const label nReq = Pstream::nRequests();
forAll(fldBf, patchi)
{
......
......@@ -46,7 +46,7 @@ void Foam::Pstream::exchangeContainer
const bool block
)
{
label startOfRequests = Pstream::nRequests();
const label startOfRequests = Pstream::nRequests();
// Set up receives
// ~~~~~~~~~~~~~~~
......@@ -120,7 +120,7 @@ void Foam::Pstream::exchangeBuf
const bool block
)
{
label startOfRequests = Pstream::nRequests();
const label startOfRequests = Pstream::nRequests();
// Set up receives
// ~~~~~~~~~~~~~~~
......
......@@ -414,7 +414,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::evaluate()
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
)
{
label nReq = Pstream::nRequests();
const label nReq = Pstream::nRequests();
forAll(*this, patchi)
{
......
......@@ -455,7 +455,7 @@ bool Foam::OFstreamCollator::write
// Gather all data onto master. Is done in local communicator since
// not in write thread. Note that we do not store in contiguous
// buffer since that would limit to 2G chars.
label startOfRequests = Pstream::nRequests();
const label startOfRequests = Pstream::nRequests();
if (Pstream::master(localComm_))
{
for (label proci = 1; proci < slaveData.size(); proci++)
......
......@@ -279,6 +279,8 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
patchFaceRestrictAddressing_[fineLevelIndex];
const label nReq = Pstream::nRequests();
// Initialise transfer of restrict addressing on the interface
forAll(fineInterfaces, inti)
{
......@@ -294,7 +296,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
if (Pstream::parRun())
{
Pstream::waitRequests();
Pstream::waitRequests(nReq);
}
......
......@@ -147,6 +147,8 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
// Get the interface cells
PtrList<labelList> nbrGlobalCells(interfaces.size());
{
const label nReq = Pstream::nRequests();
// Initialise transfer of restrict addressing on the interface
forAll(interfaces, inti)
{
......@@ -162,7 +164,7 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
if (Pstream::parRun())
{
Pstream::waitRequests();
Pstream::waitRequests(nReq);
}
forAll(interfaces, inti)
......
......@@ -95,6 +95,8 @@ void Foam::volPointInterpolation::addSeparated
typename GeometricField<Type, pointPatchField, pointMesh>::
Boundary& pfbf = pf.boundaryFieldRef();
const label nReq = Pstream::nRequests();
forAll(pfbf, patchi)
{
if (pfbf[patchi].coupled())
......@@ -109,7 +111,7 @@ void Foam::volPointInterpolation::addSeparated
}
// Block for any outstanding requests
Pstream::waitRequests();
Pstream::waitRequests(nReq);
forAll(pfbf, patchi)
{
......
......@@ -46,7 +46,7 @@ void Foam::functionObjects::mapFields::evaluateConstraintTypes
|| Pstream::defaultCommsType == Pstream::commsTypes::nonBlocking
)
{
label nReq = Pstream::nRequests();
const label nReq = Pstream::nRequests();
forAll(fldBf, patchi)
{
......
......@@ -55,6 +55,8 @@ void Foam::MGridGenGAMGAgglomeration::swap
PtrList<labelList>& nbrValues
) const
{
const label nReq = Pstream::nRequests();
// Initialise transfer of restrict addressing on the interface
forAll(interfaces, inti)
{
......@@ -70,7 +72,7 @@ void Foam::MGridGenGAMGAgglomeration::swap
if (Pstream::parRun())
{
Pstream::waitRequests();
Pstream::waitRequests(nReq);
}
// Get the interface agglomeration
......
......@@ -899,7 +899,7 @@ void Foam::dynamicOversetFvMesh::correctCoupledBoundaryConditions(GeoField& fld)
{
typename GeoField::Boundary& bfld = fld.boundaryFieldRef();
label nReq = Pstream::nRequests();
const label nReq = Pstream::nRequests();
forAll(bfld, patchi)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment