mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: earlier exit from interface polling in updateMatrixInterfaces
- exit the wait-some polling loop when no interfaces are left to be updated
This commit is contained in:
@ -128,17 +128,26 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
|||||||
// without waiting for all requests.
|
// without waiting for all requests.
|
||||||
|
|
||||||
DynamicList<int> indices; // (work array)
|
DynamicList<int> indices; // (work array)
|
||||||
while
|
|
||||||
|
for
|
||||||
(
|
(
|
||||||
UPstream::nPollProcInterfaces < 0
|
bool pollingActive = (UPstream::nPollProcInterfaces < 0);
|
||||||
|
(
|
||||||
|
pollingActive
|
||||||
&& UPstream::waitSomeRequests(startRequest, &indices)
|
&& UPstream::waitSomeRequests(startRequest, &indices)
|
||||||
|
);
|
||||||
|
/*nil*/
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
pollingActive = false;
|
||||||
|
|
||||||
forAll(interfaces_, interfacei)
|
forAll(interfaces_, interfacei)
|
||||||
{
|
{
|
||||||
auto* intf = interfaces_.get(interfacei);
|
auto* intf = interfaces_.get(interfacei);
|
||||||
|
|
||||||
if (intf && !intf->updatedMatrix() && intf->ready())
|
if (intf && !intf->updatedMatrix())
|
||||||
|
{
|
||||||
|
if (intf->ready())
|
||||||
{
|
{
|
||||||
intf->updateInterfaceMatrix
|
intf->updateInterfaceMatrix
|
||||||
(
|
(
|
||||||
@ -151,6 +160,11 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
|||||||
commsType
|
commsType
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pollingActive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,17 +131,33 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
|||||||
// without waiting for all requests.
|
// without waiting for all requests.
|
||||||
|
|
||||||
DynamicList<int> indices; // (work array)
|
DynamicList<int> indices; // (work array)
|
||||||
while
|
|
||||||
|
// const label maxPolling =
|
||||||
|
// (
|
||||||
|
// (UPstream::nPollProcInterfaces < 0)
|
||||||
|
// ? (UPstream::nRequests() - startRequest)
|
||||||
|
// : UPstream::nPollProcInterfaces
|
||||||
|
// );
|
||||||
|
|
||||||
|
for
|
||||||
(
|
(
|
||||||
UPstream::nPollProcInterfaces < 0
|
bool pollingActive = (UPstream::nPollProcInterfaces < 0);
|
||||||
|
(
|
||||||
|
pollingActive
|
||||||
&& UPstream::waitSomeRequests(startRequest, &indices)
|
&& UPstream::waitSomeRequests(startRequest, &indices)
|
||||||
|
);
|
||||||
|
/*nil*/
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
pollingActive = false;
|
||||||
|
|
||||||
forAll(interfaces, interfacei)
|
forAll(interfaces, interfacei)
|
||||||
{
|
{
|
||||||
auto* intf = interfaces.get(interfacei);
|
auto* intf = interfaces.get(interfacei);
|
||||||
|
|
||||||
if (intf && !intf->updatedMatrix() && intf->ready())
|
if (intf && !intf->updatedMatrix())
|
||||||
|
{
|
||||||
|
if (intf->ready())
|
||||||
{
|
{
|
||||||
intf->updateInterfaceMatrix
|
intf->updateInterfaceMatrix
|
||||||
(
|
(
|
||||||
@ -155,6 +171,11 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
|||||||
commsType
|
commsType
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pollingActive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user