Merge branch 'update-Pstream-message-count' into 'develop'
Use MPI Get_elements_x() for message sizes See merge request Development/openfoam!681
This commit is contained in:
commit
7dc9ccdcaa
@ -62,7 +62,7 @@ scalar sumReduce
|
||||
scalar procValue;
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::commsTypes::buffered,
|
||||
proci,
|
||||
reinterpret_cast<char*>(&procValue),
|
||||
sizeof(scalar),
|
||||
@ -79,7 +79,7 @@ scalar sumReduce
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::commsTypes::buffered,
|
||||
proci,
|
||||
reinterpret_cast<const char*>(&sum),
|
||||
sizeof(scalar),
|
||||
@ -93,7 +93,7 @@ scalar sumReduce
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::commsTypes::buffered,
|
||||
UPstream::masterNo(),
|
||||
reinterpret_cast<const char*>(&localValue),
|
||||
sizeof(scalar),
|
||||
@ -105,7 +105,7 @@ scalar sumReduce
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::commsTypes::buffered,
|
||||
UPstream::masterNo(),
|
||||
reinterpret_cast<char*>(&sum),
|
||||
sizeof(scalar),
|
||||
|
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
Pstream::myProcNo()
|
||||
);
|
||||
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
if (!Pstream::master())
|
||||
{
|
||||
@ -150,7 +150,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Do a non-blocking send inbetween
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ void testTransfer(const T& input)
|
||||
for (const int proci : UPstream::subProcs())
|
||||
{
|
||||
Perr<< "master sending to proc:" << proci << endl;
|
||||
OPstream os(UPstream::commsTypes::blocking, proci);
|
||||
OPstream os(UPstream::commsTypes::buffered, proci);
|
||||
os << data;
|
||||
}
|
||||
}
|
||||
@ -139,7 +139,7 @@ void testTransfer(const T& input)
|
||||
{
|
||||
{
|
||||
Perr<< "proc sending to master" << endl;
|
||||
OPstream os(UPstream::commsTypes::blocking, UPstream::masterNo());
|
||||
OPstream os(UPstream::commsTypes::buffered, UPstream::masterNo());
|
||||
os << data;
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ void testTokenized(const T& data)
|
||||
for (const int proci : UPstream::subProcs())
|
||||
{
|
||||
Perr<< "master sending to proc:" << proci << endl;
|
||||
OPstream os(UPstream::commsTypes::blocking, proci);
|
||||
OPstream os(UPstream::commsTypes::buffered, proci);
|
||||
os << tok;
|
||||
}
|
||||
}
|
||||
@ -177,7 +177,7 @@ void testTokenized(const T& data)
|
||||
{
|
||||
{
|
||||
Perr<< "proc sending to master" << endl;
|
||||
OPstream os(UPstream::commsTypes::blocking, UPstream::masterNo());
|
||||
OPstream os(UPstream::commsTypes::buffered, UPstream::masterNo());
|
||||
os << tok;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ Description
|
||||
Format options:
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
commsType | blocking/nonBlocking/scheduled | no | scheduled
|
||||
commsType | scheduled/nonBlocking/buffered | no | scheduled
|
||||
merge | Enable geometry/field merging | no | true
|
||||
write | Write file(s) | no | false
|
||||
narrow | Communicate with narrowed values | no | false
|
||||
|
@ -618,7 +618,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
||||
labelList rotation(faces.size(), Zero);
|
||||
labelList faceMap(faces.size(), label(-1));
|
||||
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
// Send ordering
|
||||
forAll(sortMesh.boundaryMesh(), patchi)
|
||||
|
@ -568,10 +568,9 @@ void syncPoints
|
||||
}
|
||||
}
|
||||
|
||||
// buffered send
|
||||
OPstream toNbr
|
||||
(
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::commsTypes::buffered,
|
||||
procPatch.neighbProcNo()
|
||||
);
|
||||
toNbr << patchInfo;
|
||||
|
@ -184,7 +184,7 @@ Foam::parLagrangianDistributor::distributeLagrangianPositions
|
||||
labelListList sendMap;
|
||||
|
||||
// Transfer buffers
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
{
|
||||
// List of lists of particles to be transferred for all of the
|
||||
|
@ -48,7 +48,7 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ OptimisationSwitches
|
||||
// MPI/Parallel settings
|
||||
// =====================
|
||||
|
||||
// Default communication type (nonBlocking | scheduled | blocking);
|
||||
// Default communication type (nonBlocking | scheduled | buffered)
|
||||
commsType nonBlocking;
|
||||
|
||||
// Transfer double as float for processor boundaries. Mostly defunct.
|
||||
|
@ -115,7 +115,7 @@ void Foam::ParSortableList<Type>::checkAndSend
|
||||
}
|
||||
|
||||
{
|
||||
OPstream toProc(UPstream::commsTypes::blocking, destProci);
|
||||
OPstream toProc(UPstream::commsTypes::buffered, destProci);
|
||||
toProc << values << indices;
|
||||
}
|
||||
}
|
||||
@ -309,7 +309,7 @@ void Foam::ParSortableList<Type>::sort()
|
||||
Pout<< "Receiving from " << proci << endl;
|
||||
}
|
||||
|
||||
IPstream fromProc(UPstream::commsTypes::blocking, proci);
|
||||
IPstream fromProc(UPstream::commsTypes::buffered, proci);
|
||||
|
||||
fromProc >> recValues >> recIndices;
|
||||
|
||||
|
@ -545,7 +545,7 @@ bool Foam::decomposedBlockData::readBlocks
|
||||
}
|
||||
else
|
||||
{
|
||||
PstreamBuffers pBufs(comm, UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs(comm);
|
||||
|
||||
if (UPstream::master(comm))
|
||||
{
|
||||
@ -667,7 +667,7 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks
|
||||
}
|
||||
else
|
||||
{
|
||||
PstreamBuffers pBufs(comm, UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs(comm);
|
||||
|
||||
if (UPstream::master(comm))
|
||||
{
|
||||
|
@ -115,7 +115,7 @@ void Foam::masterOFstream::commit()
|
||||
}
|
||||
|
||||
// Different files
|
||||
PstreamBuffers pBufs(comm_, UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs(comm_);
|
||||
|
||||
if (!UPstream::master(comm_))
|
||||
{
|
||||
|
@ -101,6 +101,12 @@ Foam::UOPstream::~UOPstream()
|
||||
{
|
||||
if (sendAtDestruct_)
|
||||
{
|
||||
// Note: sendAtDestruct_ and nonBlocking is a questionable combination
|
||||
// since the transfer buffer will be destroyed before
|
||||
// the non-blocking send completes!
|
||||
//
|
||||
// Could flag as an error, but not actually used anywhere.
|
||||
|
||||
if (!bufferIPCsend())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
|
@ -32,13 +32,13 @@ Description
|
||||
|
||||
Use UOPstream to stream data into buffers, call finishedSends() to
|
||||
notify that data is in buffers and then use IUPstream to get data out
|
||||
of received buffers. Works with both blocking and non-blocking. Does
|
||||
of received buffers. Works with both buffered and non-blocking. Does
|
||||
not make much sense with scheduled since there you would not need these
|
||||
explicit buffers.
|
||||
|
||||
Example usage:
|
||||
\code
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
for (const int proci : UPstream::allProcs())
|
||||
{
|
||||
@ -51,7 +51,7 @@ Description
|
||||
}
|
||||
}
|
||||
|
||||
pBufs.finishedSends(); // no-op for blocking
|
||||
pBufs.finishedSends(); // no-op for buffered
|
||||
|
||||
for (const int proci : UPstream::allProcs())
|
||||
{
|
||||
@ -68,7 +68,7 @@ Description
|
||||
one-to-all and all-to-one communication patterns.
|
||||
For example,
|
||||
\code
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
if (UPstream::master())
|
||||
{
|
||||
@ -96,7 +96,7 @@ Description
|
||||
|
||||
For example,
|
||||
\code
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
pBufs.initRegisterSend();
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -96,7 +96,7 @@ protected:
|
||||
const int comm_;
|
||||
|
||||
//- The message size, read on bufferIPCrecv or set directly
|
||||
int messageSize_;
|
||||
label messageSize_;
|
||||
|
||||
//- Receive position in buffer data, if ony
|
||||
//- If there is no external location for recvBufPos_
|
||||
@ -279,8 +279,8 @@ public:
|
||||
// Static Functions
|
||||
|
||||
//- Read buffer contents from given processor.
|
||||
// \return the message size (bytes read)
|
||||
static label read
|
||||
// \return the message size (bytes read). May change in the future
|
||||
static std::streamsize read
|
||||
(
|
||||
const UPstream::commsTypes commsType,
|
||||
const int fromProcNo,
|
||||
@ -293,8 +293,8 @@ public:
|
||||
);
|
||||
|
||||
//- Read buffer contents (non-blocking) from given processor.
|
||||
// \return the message size (bytes read)
|
||||
inline static label read
|
||||
// \return the message size (bytes read). May change in the future
|
||||
inline static std::streamsize read
|
||||
(
|
||||
//! [out] request information
|
||||
UPstream::Request& req,
|
||||
@ -321,7 +321,7 @@ public:
|
||||
// Only valid for contiguous data types.
|
||||
// \return the message size (bytes read). May change in the future
|
||||
template<class Type>
|
||||
inline static label read
|
||||
inline static std::streamsize read
|
||||
(
|
||||
const UPstream::commsTypes commsType,
|
||||
const int fromProcNo,
|
||||
@ -348,7 +348,7 @@ public:
|
||||
// Only valid for contiguous data types.
|
||||
// \return the message size (bytes read). May change in the future
|
||||
template<class Type>
|
||||
inline static label read
|
||||
inline static std::streamsize read
|
||||
(
|
||||
const UPstream::commsTypes commsType,
|
||||
const int fromProcNo,
|
||||
@ -375,7 +375,7 @@ public:
|
||||
// Only valid for contiguous data types.
|
||||
// \return the message size (bytes read). May change in the future
|
||||
template<class Type>
|
||||
inline static label read
|
||||
inline static std::streamsize read
|
||||
(
|
||||
//! [out] request information
|
||||
UPstream::Request& req,
|
||||
@ -401,7 +401,7 @@ public:
|
||||
// Only valid for contiguous data types.
|
||||
// \return the message size (bytes read). May change in the future
|
||||
template<class Type>
|
||||
inline static label read
|
||||
inline static std::streamsize read
|
||||
(
|
||||
//! [out] request information
|
||||
UPstream::Request& req,
|
||||
@ -474,8 +474,8 @@ public:
|
||||
// Static Functions
|
||||
|
||||
//- Wrapped version of UPstream::broadcast
|
||||
// \return the message size (bytes read)
|
||||
static label read
|
||||
// \return the message size (bytes read). May change in the future
|
||||
static std::streamsize read
|
||||
(
|
||||
const int rootProcNo, //!< normally UPstream::masterNo()
|
||||
char* buf,
|
||||
|
@ -50,9 +50,11 @@ const Foam::Enum
|
||||
>
|
||||
Foam::UPstream::commsTypeNames
|
||||
({
|
||||
{ commsTypes::blocking, "blocking" }, // "buffered"
|
||||
{ commsTypes::buffered, "buffered" }, // "buffered"
|
||||
{ commsTypes::scheduled, "scheduled" },
|
||||
{ commsTypes::nonBlocking, "nonBlocking" }, // "immediate"
|
||||
// compatibility names
|
||||
{ commsTypes::buffered, "blocking" },
|
||||
});
|
||||
|
||||
|
||||
|
@ -73,15 +73,17 @@ public:
|
||||
//- Communications types
|
||||
enum class commsTypes : char
|
||||
{
|
||||
blocking, //!< "blocking" (buffered) : (MPI_Bsend, MPI_Recv)
|
||||
buffered, //!< "buffered" : (MPI_Bsend, MPI_Recv)
|
||||
scheduled, //!< "scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
|
||||
nonBlocking //!< "nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
|
||||
nonBlocking, //!< "nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
|
||||
// Aliases
|
||||
blocking = buffered //!< compatibility name for buffered
|
||||
};
|
||||
|
||||
//- Enumerated names for the communication types
|
||||
static const Enum<commsTypes> commsTypeNames;
|
||||
|
||||
//- Different MPI-send modes (ignored for commsTypes::blocking)
|
||||
//- Different MPI-send modes (ignored for commsTypes::buffered)
|
||||
enum class sendModes : char
|
||||
{
|
||||
normal, //!< (MPI_Send, MPI_Isend)
|
||||
|
@ -598,7 +598,7 @@ void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::evaluate()
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -689,7 +689,7 @@ void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::evaluateLocal()
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -755,7 +755,7 @@ Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ public:
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
|
||||
|
@ -119,7 +119,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
) = 0;
|
||||
|
||||
//- Initialise swap of patch point values
|
||||
|
@ -202,7 +202,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
|
||||
|
@ -152,7 +152,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -115,7 +115,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -115,7 +115,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -154,7 +154,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -153,7 +153,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -126,7 +126,7 @@ public:
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -121,7 +121,7 @@ public:
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -192,7 +192,7 @@ Foam::codedFixedValuePointPatchField<Type>::codedFixedValuePointPatchField
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ public:
|
||||
//- Evaluate the patch field, sets updated() to false
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Write
|
||||
|
@ -132,7 +132,7 @@ public:
|
||||
//- Update the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Write
|
||||
|
@ -562,14 +562,14 @@ public:
|
||||
//- Initialise evaluation of the patch field (do nothing)
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
//- Evaluate the patch field, sets updated() to false
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Initialise the evaluation of the patch field after a local
|
||||
@ -577,7 +577,7 @@ public:
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -585,7 +585,7 @@ public:
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -452,7 +452,7 @@ Foam::fileOperations::masterUncollatedFileOperation::read
|
||||
{
|
||||
autoPtr<ISstream> isPtr;
|
||||
|
||||
PstreamBuffers pBufs(comm, UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs(comm);
|
||||
|
||||
if (UPstream::master(comm))
|
||||
{
|
||||
@ -1834,7 +1834,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::readHeader
|
||||
}
|
||||
|
||||
// Is a more efficient scatter possible?
|
||||
PstreamBuffers pBufs(comm_, UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs(comm_);
|
||||
|
||||
if (Pstream::master(comm_))
|
||||
{
|
||||
@ -2396,7 +2396,7 @@ Foam::fileOperations::masterUncollatedFileOperation::NewIFstream
|
||||
filePaths[Pstream::myProcNo(comm_)] = filePath;
|
||||
Pstream::gatherList(filePaths, Pstream::msgType(), comm_);
|
||||
|
||||
PstreamBuffers pBufs(comm_, Pstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs(comm_);
|
||||
|
||||
if (Pstream::master(comm_))
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -88,7 +88,7 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
UPstream::commsTypes::blocking
|
||||
UPstream::commsTypes::buffered
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -172,7 +172,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -184,7 +184,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
}
|
||||
|
||||
// Check/no-check for updatedMatrix() ?
|
||||
const bool noCheck = (commsType == UPstream::commsTypes::blocking);
|
||||
const bool noCheck = (commsType == UPstream::commsTypes::buffered);
|
||||
|
||||
forAll(interfaces_, interfacei)
|
||||
{
|
||||
@ -264,7 +264,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
UPstream::commsTypes::blocking
|
||||
UPstream::commsTypes::buffered
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ void Foam::processorLduInterface::send
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
@ -113,7 +113,7 @@ void Foam::processorLduInterface::receive
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
@ -194,7 +194,7 @@ void Foam::processorLduInterface::compressedSend
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
@ -272,7 +272,7 @@ void Foam::processorLduInterface::compressedReceive
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ void Foam::lduMatrix::initMatrixInterfaces
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -90,7 +90,7 @@ void Foam::lduMatrix::initMatrixInterfaces
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
UPstream::commsTypes::blocking
|
||||
UPstream::commsTypes::buffered
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -229,7 +229,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -241,7 +241,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
}
|
||||
|
||||
// Check/no-check for updatedMatrix() ?
|
||||
const bool noCheck = (commsType == UPstream::commsTypes::blocking);
|
||||
const bool noCheck = (commsType == UPstream::commsTypes::buffered);
|
||||
|
||||
// Consume anything still outstanding
|
||||
forAll(interfaces, interfacei)
|
||||
@ -326,7 +326,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
UPstream::commsTypes::blocking
|
||||
UPstream::commsTypes::buffered
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -311,12 +311,7 @@ void Foam::GAMGSolver::gatherMatrices
|
||||
const auto& boundaryMap = agglomeration_.boundaryMap(destLevel);
|
||||
|
||||
// Use PstreamBuffers
|
||||
PstreamBuffers pBufs
|
||||
(
|
||||
UPstream::commsTypes::nonBlocking,
|
||||
UPstream::msgType(),
|
||||
comm
|
||||
);
|
||||
PstreamBuffers pBufs(comm);
|
||||
|
||||
// Send to master
|
||||
if (!UPstream::master(comm))
|
||||
|
@ -1344,12 +1344,7 @@ void Foam::lduPrimitiveMesh::gather
|
||||
(void)mesh.lduAddr().patchSchedule();
|
||||
|
||||
// Use PstreamBuffers
|
||||
PstreamBuffers pBufs
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
UPstream::msgType(),
|
||||
comm
|
||||
);
|
||||
PstreamBuffers pBufs(comm);
|
||||
|
||||
// Send to master
|
||||
if (!Pstream::master(comm))
|
||||
|
@ -111,7 +111,7 @@ void Foam::pointBoundaryMesh::calcGeometry()
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -157,7 +157,7 @@ void Foam::pointBoundaryMesh::movePoints(const pointField& p)
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -203,7 +203,7 @@ void Foam::pointBoundaryMesh::updateMesh()
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
|
@ -494,7 +494,7 @@ void Foam::mapDistributeBase::distribute
|
||||
return;
|
||||
}
|
||||
|
||||
if (commsType == UPstream::commsTypes::blocking)
|
||||
if (commsType == UPstream::commsTypes::buffered)
|
||||
{
|
||||
// Since buffered sending can reuse the field to collect the
|
||||
// received data.
|
||||
@ -681,7 +681,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
if (!is_contiguous<T>::value)
|
||||
{
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking, tag, comm);
|
||||
PstreamBuffers pBufs(comm, tag);
|
||||
|
||||
// Stream data into buffer
|
||||
for (const int proci : UPstream::allProcs(comm))
|
||||
@ -939,7 +939,7 @@ void Foam::mapDistributeBase::distribute
|
||||
return;
|
||||
}
|
||||
|
||||
if (commsType == UPstream::commsTypes::blocking)
|
||||
if (commsType == UPstream::commsTypes::buffered)
|
||||
{
|
||||
// Since buffered sending can reuse the field to collect the
|
||||
// received data.
|
||||
@ -1121,7 +1121,7 @@ void Foam::mapDistributeBase::distribute
|
||||
|
||||
if (!is_contiguous<T>::value)
|
||||
{
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking, tag, comm);
|
||||
PstreamBuffers pBufs(comm, tag);
|
||||
|
||||
// Stream data into buffer
|
||||
for (const int proci : UPstream::allProcs(comm))
|
||||
|
@ -304,7 +304,7 @@ void Foam::polyBoundaryMesh::calcGeometry()
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -1297,7 +1297,7 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p)
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -1347,7 +1347,7 @@ void Foam::polyBoundaryMesh::updateMesh()
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ void Foam::syncTools::syncPointMap
|
||||
// Presize according to number of processor patches
|
||||
// (global topology information may not yet be available...)
|
||||
DynamicList<label> neighbProcs(patches.nProcessorPatches());
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
// Reduce communication by only sending non-zero data,
|
||||
// but with multiply-connected processor/processor
|
||||
@ -396,7 +396,7 @@ void Foam::syncTools::syncEdgeMap
|
||||
// Presize according to number of processor patches
|
||||
// (global topology information may not yet be available...)
|
||||
DynamicList<label> neighbProcs(patches.nProcessorPatches());
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
// Reduce communication by only sending non-zero data,
|
||||
// but with multiply-connected processor/processor
|
||||
@ -1142,7 +1142,7 @@ void Foam::syncTools::syncBoundaryFaceList
|
||||
else
|
||||
{
|
||||
DynamicList<label> neighbProcs;
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
// Send
|
||||
for (const polyPatch& pp : patches)
|
||||
|
@ -1092,7 +1092,7 @@ void Foam::globalIndex::get
|
||||
);
|
||||
|
||||
// Send local indices to individual processors as local index
|
||||
PstreamBuffers sendBufs(UPstream::commsTypes::nonBlocking, tag, comm);
|
||||
PstreamBuffers sendBufs(comm, tag);
|
||||
|
||||
for (const auto proci : validBins)
|
||||
{
|
||||
@ -1109,7 +1109,7 @@ void Foam::globalIndex::get
|
||||
sendBufs.finishedSends();
|
||||
|
||||
|
||||
PstreamBuffers returnBufs(UPstream::commsTypes::nonBlocking, tag, comm);
|
||||
PstreamBuffers returnBufs(comm, tag);
|
||||
|
||||
for (const int proci : sendBufs.allProcs())
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2022-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2022-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,7 +37,7 @@ void Foam::UIPBstream::bufferIPCrecv()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::UIPBstream::read
|
||||
std::streamsize Foam::UIPBstream::read
|
||||
(
|
||||
const int rootProcNo,
|
||||
char* buf,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,7 +38,7 @@ void Foam::UIPstream::bufferIPCrecv()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::UIPstream::read
|
||||
std::streamsize Foam::UIPstream::read
|
||||
(
|
||||
const UPstream::commsTypes commsType,
|
||||
const int fromProcNo,
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2022-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2022-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -39,7 +39,7 @@ void Foam::UIPBstream::bufferIPCrecv()
|
||||
|
||||
// Expected message size, similar to MPI_Probe
|
||||
// Same type must be expected in UOPBstream::bufferIPCsend()
|
||||
label bufSize(0);
|
||||
std::streamsize bufSize(0);
|
||||
|
||||
// Broadcast #1 - data size
|
||||
if
|
||||
@ -47,7 +47,7 @@ void Foam::UIPBstream::bufferIPCrecv()
|
||||
!UPstream::broadcast
|
||||
(
|
||||
reinterpret_cast<char*>(&bufSize),
|
||||
sizeof(label),
|
||||
sizeof(std::streamsize),
|
||||
comm_,
|
||||
fromProcNo_ //< is actually rootProcNo
|
||||
)
|
||||
@ -63,46 +63,45 @@ void Foam::UIPBstream::bufferIPCrecv()
|
||||
Pout<< "UOPBstream IPC read buffer :"
|
||||
<< " root:" << fromProcNo_
|
||||
<< " comm:" << comm_
|
||||
<< " probed size:" << bufSize
|
||||
<< " probed size:" << label(bufSize)
|
||||
<< " wanted size:" << recvBuf_.capacity()
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
// No buffer size allocated/specified
|
||||
if (!recvBuf_.capacity())
|
||||
|
||||
// Set buffer size, avoiding any copying and resize doubling etc.
|
||||
recvBuf_.clear();
|
||||
if (recvBuf_.capacity() < label(bufSize))
|
||||
{
|
||||
recvBuf_.resize(bufSize);
|
||||
recvBuf_.setCapacity_nocopy(label(bufSize));
|
||||
}
|
||||
recvBuf_.resize_nocopy(label(bufSize));
|
||||
|
||||
// This is the only real information we can trust
|
||||
messageSize_ = bufSize;
|
||||
messageSize_ = label(bufSize);
|
||||
|
||||
|
||||
// Broadcast #2 - data content
|
||||
// - skip if there is no data to receive
|
||||
|
||||
if (messageSize_)
|
||||
{
|
||||
if
|
||||
if
|
||||
(
|
||||
(bufSize > 0)
|
||||
&& !UPstream::broadcast
|
||||
(
|
||||
!UPstream::broadcast
|
||||
(
|
||||
recvBuf_.data(),
|
||||
messageSize_, // same as bufSize
|
||||
comm_,
|
||||
fromProcNo_ //< is actually rootProcNo
|
||||
)
|
||||
recvBuf_.data(),
|
||||
recvBuf_.size(), // same as bufSize
|
||||
comm_,
|
||||
fromProcNo_ //< is actually rootProcNo
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Bcast failure receiving buffer data:" << bufSize << nl
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Bcast failure receiving buffer data:"
|
||||
<< recvBuf_.size() << nl
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
// Set addressed size. Leave actual allocated memory intact.
|
||||
recvBuf_.resize(messageSize_);
|
||||
|
||||
if (!messageSize_)
|
||||
if (recvBuf_.empty())
|
||||
{
|
||||
setEof();
|
||||
}
|
||||
@ -111,7 +110,7 @@ void Foam::UIPBstream::bufferIPCrecv()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::UIPBstream::read
|
||||
std::streamsize Foam::UIPBstream::read
|
||||
(
|
||||
const int rootProcNo,
|
||||
char* buf,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -35,11 +35,12 @@ License
|
||||
// - as of 2023-06 appears to be broken with INTELMPI + PMI-2 (slurm)
|
||||
// and perhaps other places so currently avoid
|
||||
|
||||
#undef Pstream_use_MPI_Get_count
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
// General blocking/non-blocking MPI receive, optionally with probed
|
||||
// message information.
|
||||
static Foam::label UPstream_mpi_receive
|
||||
// General blocking/non-blocking MPI receive
|
||||
static std::streamsize UPstream_mpi_receive
|
||||
(
|
||||
const Foam::UPstream::commsTypes commsType,
|
||||
char* buf,
|
||||
@ -54,34 +55,48 @@ static Foam::label UPstream_mpi_receive
|
||||
|
||||
PstreamGlobals::reset_request(req);
|
||||
|
||||
if (UPstream::debug)
|
||||
// TODO: some corrective action, at least when not nonBlocking
|
||||
#if 0
|
||||
// No warnings here, just on the sender side.
|
||||
if (bufSize > std::streamsize(INT_MAX))
|
||||
{
|
||||
Pout<< "UIPstream::read : starting read from:" << fromProcNo
|
||||
<< " tag:" << tag << " comm:" << communicator
|
||||
<< " wanted size:" << label(bufSize)
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
<< Foam::endl;
|
||||
Perr<< "UIPstream::read() : from rank " << fromProcNo
|
||||
<< " exceeds INT_MAX bytes" << Foam::endl;
|
||||
error::printStack(Perr);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (UPstream::warnComm >= 0 && communicator != UPstream::warnComm)
|
||||
{
|
||||
Pout<< "UIPstream::read : starting read from:" << fromProcNo
|
||||
<< " size:" << label(bufSize)
|
||||
<< " tag:" << tag << " comm:" << communicator
|
||||
<< " wanted size:" << label(bufSize)
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
<< " warnComm:" << UPstream::warnComm
|
||||
<< Foam::endl;
|
||||
error::printStack(Pout);
|
||||
}
|
||||
else if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UIPstream::read : starting read from:" << fromProcNo
|
||||
<< " size:" << label(bufSize)
|
||||
<< " tag:" << tag << " comm:" << communicator
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
int returnCode = MPI_ERR_UNKNOWN;
|
||||
|
||||
profilingPstream::beginTiming();
|
||||
|
||||
if
|
||||
(
|
||||
commsType == UPstream::commsTypes::blocking
|
||||
commsType == UPstream::commsTypes::buffered
|
||||
|| commsType == UPstream::commsTypes::scheduled
|
||||
)
|
||||
{
|
||||
int returnCode = 0;
|
||||
// Not UPstream::commsTypes::nonBlocking
|
||||
|
||||
MPI_Status status;
|
||||
|
||||
{
|
||||
@ -97,6 +112,8 @@ static Foam::label UPstream_mpi_receive
|
||||
);
|
||||
}
|
||||
|
||||
profilingPstream::addGatherTime();
|
||||
|
||||
if (returnCode != MPI_SUCCESS)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -104,36 +121,53 @@ static Foam::label UPstream_mpi_receive
|
||||
<< Foam::abort(FatalError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
profilingPstream::addGatherTime();
|
||||
|
||||
// Check size of message read
|
||||
|
||||
int messageSize;
|
||||
MPI_Get_count(&status, MPI_BYTE, &messageSize);
|
||||
|
||||
if (UPstream::debug)
|
||||
else if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UIPstream::read : finished read from:" << fromProcNo
|
||||
<< " tag:" << tag << " read size:" << label(bufSize)
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
Pout<< "UIPstream::read : finished recv from:"
|
||||
<< fromProcNo
|
||||
<< " size:" << label(bufSize) << " tag:" << tag
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
if (messageSize > bufSize)
|
||||
// Check size of message read
|
||||
#ifdef Pstream_use_MPI_Get_count
|
||||
int count(0);
|
||||
MPI_Get_count(&status, MPI_BYTE, &count);
|
||||
#else
|
||||
MPI_Count count(0);
|
||||
MPI_Get_elements_x(&status, MPI_BYTE, &count);
|
||||
#endif
|
||||
|
||||
// Errors
|
||||
if (count == MPI_UNDEFINED || int64_t(count) < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Get_count() or MPI_Get_elements_x() : "
|
||||
"returned undefined or negative value"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
else if (int64_t(count) > int64_t(UList<char>::max_size()))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Get_count() or MPI_Get_elements_x() : "
|
||||
"count is larger than UList<char>::max_size() bytes"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
if (bufSize < std::streamsize(count))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "buffer (" << label(bufSize)
|
||||
<< ") not large enough for incoming message ("
|
||||
<< messageSize << ')'
|
||||
<< label(count) << ')'
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
return messageSize;
|
||||
return std::streamsize(count);
|
||||
}
|
||||
else if (commsType == UPstream::commsTypes::nonBlocking)
|
||||
{
|
||||
int returnCode = 0;
|
||||
MPI_Request request;
|
||||
|
||||
{
|
||||
@ -158,19 +192,20 @@ static Foam::label UPstream_mpi_receive
|
||||
return 0;
|
||||
}
|
||||
|
||||
PstreamGlobals::push_request(request, req);
|
||||
profilingPstream::addRequestTime();
|
||||
|
||||
|
||||
if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UIPstream::read : started read from:" << fromProcNo
|
||||
<< " tag:" << tag << " read size:" << label(bufSize)
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
Pout<< "UIPstream::read : started non-blocking recv from:"
|
||||
<< fromProcNo
|
||||
<< " size:" << label(bufSize) << " tag:" << tag
|
||||
<< " request:" <<
|
||||
(req ? label(-1) : PstreamGlobals::outstandingRequests_.size())
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
PstreamGlobals::push_request(request, req);
|
||||
profilingPstream::addRequestTime();
|
||||
|
||||
// Assume the message will be completely received.
|
||||
return bufSize;
|
||||
}
|
||||
@ -197,9 +232,24 @@ void Foam::UIPstream::bufferIPCrecv()
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
// No buffer size allocated/specified - probe size of incoming message
|
||||
if (!recvBuf_.capacity())
|
||||
// Fallback value
|
||||
messageSize_ = recvBuf_.capacity();
|
||||
|
||||
if (commsType() == UPstream::commsTypes::nonBlocking)
|
||||
{
|
||||
// Non-blocking
|
||||
// ~~~~~~~~~~~~
|
||||
// No chance of probing for size nor relying on the returned message
|
||||
// size (since it returns immediately without any further checks)
|
||||
//
|
||||
// Fortunately there are not many (any?) places that are using
|
||||
// a non-blocking IPstream with streaming anyhow.
|
||||
|
||||
messageSize_ = recvBuf_.size();
|
||||
}
|
||||
else if (!recvBuf_.capacity())
|
||||
{
|
||||
// No buffer size allocated/specified - probe size of incoming message
|
||||
profilingPstream::beginTiming();
|
||||
|
||||
MPI_Status status;
|
||||
@ -212,34 +262,73 @@ void Foam::UIPstream::bufferIPCrecv()
|
||||
&status
|
||||
);
|
||||
|
||||
MPI_Get_count(&status, MPI_BYTE, &messageSize_);
|
||||
|
||||
profilingPstream::addProbeTime();
|
||||
|
||||
recvBuf_.resize(messageSize_);
|
||||
|
||||
#ifdef Pstream_use_MPI_Get_count
|
||||
int count(0);
|
||||
MPI_Get_count(&status, MPI_BYTE, &count);
|
||||
#else
|
||||
MPI_Count count(0);
|
||||
MPI_Get_elements_x(&status, MPI_BYTE, &count);
|
||||
#endif
|
||||
|
||||
// Errors
|
||||
if (count == MPI_UNDEFINED || int64_t(count) < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Get_count() or MPI_Get_elements_x() : "
|
||||
"returned undefined or negative value"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
else if (int64_t(count) > int64_t(UList<char>::max_size()))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Get_count() or MPI_Get_elements_x() : "
|
||||
"count is larger than UList<char>::max_size() bytes"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UIPstream::UIPstream : probed size:"
|
||||
<< messageSize_ << Foam::endl;
|
||||
<< label(count) << Foam::endl;
|
||||
}
|
||||
|
||||
recvBuf_.resize(label(count));
|
||||
messageSize_ = label(count);
|
||||
}
|
||||
|
||||
messageSize_ = UPstream_mpi_receive
|
||||
std::streamsize count = UPstream_mpi_receive
|
||||
(
|
||||
commsType(),
|
||||
recvBuf_.data(),
|
||||
recvBuf_.capacity(),
|
||||
messageSize_, // The expected size
|
||||
fromProcNo_,
|
||||
tag_,
|
||||
comm_,
|
||||
nullptr // UPstream::Request
|
||||
);
|
||||
|
||||
// Set addressed size. Leave actual allocated memory intact.
|
||||
recvBuf_.resize(messageSize_);
|
||||
if (count < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_recv() with negative size??"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
else if (int64_t(count) > int64_t(UList<char>::max_size()))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_recv() larger than "
|
||||
"UList<char>::max_size() bytes"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
if (!messageSize_)
|
||||
// Set addressed size. Leave actual allocated memory intact.
|
||||
recvBuf_.resize(label(count));
|
||||
messageSize_ = label(count);
|
||||
|
||||
if (recvBuf_.empty())
|
||||
{
|
||||
setEof();
|
||||
}
|
||||
@ -248,7 +337,7 @@ void Foam::UIPstream::bufferIPCrecv()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::UIPstream::read
|
||||
std::streamsize Foam::UIPstream::read
|
||||
(
|
||||
const UPstream::commsTypes commsType,
|
||||
const int fromProcNo,
|
||||
|
@ -40,7 +40,17 @@ bool Foam::UOPBstream::bufferIPCsend()
|
||||
PstreamGlobals::checkCommunicator(comm_, toProcNo_);
|
||||
|
||||
// Same type must be expected in UIPBstream::bufferIPCrecv()
|
||||
label bufSize(sendBuf_.size());
|
||||
std::streamsize bufSize(sendBuf_.size());
|
||||
|
||||
// TODO: some corrective action
|
||||
#if 0
|
||||
if (bufSize > std::streamsize(INT_MAX))
|
||||
{
|
||||
Perr<< "UOPBstream::write() :"
|
||||
<< " exceeds INT_MAX bytes" << Foam::endl;
|
||||
error::printStack(Perr);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Broadcast #1 - data size
|
||||
if
|
||||
@ -48,7 +58,7 @@ bool Foam::UOPBstream::bufferIPCsend()
|
||||
!UPstream::broadcast
|
||||
(
|
||||
reinterpret_cast<char*>(&bufSize),
|
||||
sizeof(label),
|
||||
sizeof(std::streamsize),
|
||||
comm_,
|
||||
toProcNo_ //< is actually rootProcNo
|
||||
)
|
||||
@ -60,26 +70,26 @@ bool Foam::UOPBstream::bufferIPCsend()
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Broadcast #2 - data content
|
||||
// - skip if there is no data to send
|
||||
if (bufSize)
|
||||
{
|
||||
if
|
||||
if
|
||||
(
|
||||
(bufSize > 0)
|
||||
&& !UPstream::broadcast
|
||||
(
|
||||
!UPstream::broadcast
|
||||
(
|
||||
sendBuf_.data(),
|
||||
sendBuf_.size(), // same as bufSize
|
||||
comm_,
|
||||
toProcNo_ //< is actually rootProcNo
|
||||
)
|
||||
sendBuf_.data(),
|
||||
sendBuf_.size(), // same as bufSize
|
||||
comm_,
|
||||
toProcNo_ //< is actually rootProcNo
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Bcast failure sending buffer data:" << bufSize << nl
|
||||
<< Foam::abort(FatalError);
|
||||
return false;
|
||||
}
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Bcast failure sending buffer data:"
|
||||
<< sendBuf_.size() << nl
|
||||
<< Foam::abort(FatalError);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -62,24 +62,34 @@ bool Foam::UOPstream::write
|
||||
{
|
||||
PstreamGlobals::reset_request(req);
|
||||
|
||||
if (UPstream::debug)
|
||||
// TODO: some corrective action, at least when not nonBlocking
|
||||
#if 0
|
||||
if (bufSize > std::streamsize(INT_MAX))
|
||||
{
|
||||
Pout<< "UOPstream::write : starting write to:" << toProcNo
|
||||
<< " tag:" << tag
|
||||
<< " comm:" << communicator << " size:" << label(bufSize)
|
||||
<< " commType:" << UPstream::commsTypeNames[commsType]
|
||||
<< Foam::endl;
|
||||
Perr<< "UOPstream::write() : to rank " << toProcNo
|
||||
<< " exceeds INT_MAX bytes" << Foam::endl;
|
||||
error::printStack(Perr);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (UPstream::warnComm >= 0 && communicator != UPstream::warnComm)
|
||||
{
|
||||
Pout<< "UOPstream::write : starting write to:" << toProcNo
|
||||
<< " tag:" << tag
|
||||
<< " comm:" << communicator << " size:" << label(bufSize)
|
||||
<< " size:" << label(bufSize)
|
||||
<< " tag:" << tag << " comm:" << communicator
|
||||
<< " commType:" << UPstream::commsTypeNames[commsType]
|
||||
<< " warnComm:" << UPstream::warnComm
|
||||
<< Foam::endl;
|
||||
error::printStack(Pout);
|
||||
}
|
||||
else if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UOPstream::write : starting write to:" << toProcNo
|
||||
<< " size:" << label(bufSize)
|
||||
<< " tag:" << tag << " comm:" << communicator
|
||||
<< " commType:" << UPstream::commsTypeNames[commsType]
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
PstreamGlobals::checkCommunicator(communicator, toProcNo);
|
||||
|
||||
@ -87,7 +97,7 @@ bool Foam::UOPstream::write
|
||||
|
||||
profilingPstream::beginTiming();
|
||||
|
||||
if (commsType == UPstream::commsTypes::blocking)
|
||||
if (commsType == UPstream::commsTypes::buffered)
|
||||
{
|
||||
returnCode = MPI_Bsend
|
||||
(
|
||||
@ -104,9 +114,9 @@ bool Foam::UOPstream::write
|
||||
|
||||
if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UOPstream::write : finished write to:" << toProcNo
|
||||
<< " tag:" << tag << " size:" << label(bufSize)
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
Pout<< "UOPstream::write : finished buffered send to:"
|
||||
<< toProcNo
|
||||
<< " size:" << label(bufSize) << " tag:" << tag
|
||||
<< Foam::endl;
|
||||
}
|
||||
}
|
||||
@ -142,9 +152,9 @@ bool Foam::UOPstream::write
|
||||
|
||||
if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UOPstream::write : finished write to:" << toProcNo
|
||||
<< " tag:" << tag << " size:" << label(bufSize)
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
Pout<< "UOPstream::write : finished send to:"
|
||||
<< toProcNo
|
||||
<< " size:" << label(bufSize) << " tag:" << tag
|
||||
<< Foam::endl;
|
||||
}
|
||||
}
|
||||
@ -181,9 +191,9 @@ bool Foam::UOPstream::write
|
||||
|
||||
if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UOPstream::write : started write to:" << toProcNo
|
||||
<< " tag:" << tag << " size:" << label(bufSize)
|
||||
<< " commType:" << UPstream::commsTypeNames[commsType]
|
||||
Pout<< "UOPstream::write : started non-blocking send to:"
|
||||
<< toProcNo
|
||||
<< " size:" << label(bufSize) << " tag:" << tag
|
||||
<< " request:" <<
|
||||
(req ? label(-1) : PstreamGlobals::outstandingRequests_.size())
|
||||
<< Foam::endl;
|
||||
|
@ -40,6 +40,8 @@ License
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
|
||||
#undef Pstream_use_MPI_Get_count
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// The min value and default for MPI buffer length
|
||||
@ -787,7 +789,7 @@ Foam::UPstream::probeMessage
|
||||
int flag = 0;
|
||||
MPI_Status status;
|
||||
|
||||
if (UPstream::commsTypes::blocking == commsType)
|
||||
if (UPstream::commsTypes::buffered == commsType)
|
||||
{
|
||||
// Blocking
|
||||
profilingPstream::beginTiming();
|
||||
@ -838,8 +840,36 @@ Foam::UPstream::probeMessage
|
||||
|
||||
if (flag)
|
||||
{
|
||||
// Unlikely to be used with large amounts of data,
|
||||
// but use MPI_Get_elements_x() instead of MPI_Count() anyhow
|
||||
|
||||
#ifdef Pstream_use_MPI_Get_count
|
||||
int count(0);
|
||||
MPI_Get_count(&status, MPI_BYTE, &count);
|
||||
#else
|
||||
MPI_Count count(0);
|
||||
MPI_Get_elements_x(&status, MPI_BYTE, &count);
|
||||
#endif
|
||||
|
||||
// Errors
|
||||
if (count == MPI_UNDEFINED || int64_t(count) < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Get_count() or MPI_Get_elements_x() : "
|
||||
"returned undefined or negative value"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
else if (int64_t(count) > int64_t(INT_MAX))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "MPI_Get_count() or MPI_Get_elements_x() : "
|
||||
"count is larger than INI_MAX bytes"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
result.first = status.MPI_SOURCE;
|
||||
MPI_Get_count(&status, MPI_BYTE, &result.second);
|
||||
result.second = int(count);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -47,13 +47,6 @@ bool Foam::UPstream::broadcast
|
||||
|
||||
//Needed? PstreamGlobals::checkCommunicator(comm, rootProcNo);
|
||||
|
||||
if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UPstream::broadcast : root:" << rootProcNo
|
||||
<< " comm:" << comm
|
||||
<< " size:" << label(bufSize)
|
||||
<< Foam::endl;
|
||||
}
|
||||
if (UPstream::warnComm >= 0 && comm != UPstream::warnComm)
|
||||
{
|
||||
Pout<< "UPstream::broadcast : root:" << rootProcNo
|
||||
@ -63,6 +56,13 @@ bool Foam::UPstream::broadcast
|
||||
<< Foam::endl;
|
||||
error::printStack(Pout);
|
||||
}
|
||||
else if (UPstream::debug)
|
||||
{
|
||||
Pout<< "UPstream::broadcast : root:" << rootProcNo
|
||||
<< " comm:" << comm
|
||||
<< " size:" << label(bufSize)
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
profilingPstream::beginTiming();
|
||||
|
||||
|
@ -632,7 +632,8 @@ void Foam::PstreamDetail::allToAllConsensus
|
||||
// Message found, receive into dest buffer location
|
||||
const label proci = status.MPI_SOURCE;
|
||||
|
||||
int count = 0;
|
||||
// Only send/recv a single (fundamental) data type
|
||||
int count(0);
|
||||
MPI_Get_count(&status, datatype, &count);
|
||||
|
||||
if (count != 1)
|
||||
@ -812,10 +813,10 @@ void Foam::PstreamDetail::allToAllConsensus
|
||||
if (flag)
|
||||
{
|
||||
// Message found, receive into dest buffer location
|
||||
|
||||
const label proci = status.MPI_SOURCE;
|
||||
int count = 0;
|
||||
|
||||
// Only send/recv a single (fundamental) data type
|
||||
int count(0);
|
||||
MPI_Get_count(&status, datatype, &count);
|
||||
|
||||
if (count != 1)
|
||||
|
@ -69,7 +69,7 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public:
|
||||
//- Evaluate the patchField
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Write
|
||||
|
@ -364,7 +364,7 @@ Foam::interfaceTrackingFvMesh::pointDisplacement()
|
||||
{
|
||||
OPstream toNeighbProc
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::commsTypes::buffered,
|
||||
procPatch.neighbProcNo()
|
||||
);
|
||||
|
||||
@ -375,7 +375,7 @@ Foam::interfaceTrackingFvMesh::pointDisplacement()
|
||||
{
|
||||
IPstream fromNeighbProc
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::commsTypes::buffered,
|
||||
procPatch.neighbProcNo()
|
||||
);
|
||||
|
||||
|
@ -2153,7 +2153,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
UPstream::allToAll(nSendCells, nRecvCells);
|
||||
|
||||
// Allocate buffers
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
|
||||
// What to send to neighbouring domains
|
||||
|
@ -587,12 +587,12 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
|
||||
if (schedEval.init)
|
||||
{
|
||||
displacementBf[patchi]
|
||||
.initEvaluate(Pstream::commsTypes::blocking);
|
||||
.initEvaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
else
|
||||
{
|
||||
displacementBf[patchi]
|
||||
.evaluate(Pstream::commsTypes::blocking);
|
||||
.evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -608,12 +608,12 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
|
||||
if (schedEval.init)
|
||||
{
|
||||
displacementBf[patchi]
|
||||
.initEvaluate(Pstream::commsTypes::blocking);
|
||||
.initEvaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
else
|
||||
{
|
||||
displacementBf[patchi]
|
||||
.evaluate(Pstream::commsTypes::blocking);
|
||||
.evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,12 +67,12 @@ void Foam::motionSmootherAlgo::checkConstraints
|
||||
|
||||
forAllReverse(bFld, patchi)
|
||||
{
|
||||
bFld[patchi].initEvaluate(Pstream::commsTypes::blocking); // buffered
|
||||
bFld[patchi].initEvaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
|
||||
forAllReverse(bFld, patchi)
|
||||
{
|
||||
bFld[patchi].evaluate(Pstream::commsTypes::blocking);
|
||||
bFld[patchi].evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1272,7 +1272,7 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
|
||||
// Create subsetted refinement tree consisting of all parents that
|
||||
// move in their whole to other processor.
|
||||
|
||||
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
||||
PstreamBuffers pBufs;
|
||||
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ void Foam::faBoundaryMesh::calcGeometry()
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -943,7 +943,7 @@ void Foam::faBoundaryMesh::movePoints(const pointField& p)
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
@ -989,7 +989,7 @@ void Foam::faBoundaryMesh::updateMesh()
|
||||
|
||||
if
|
||||
(
|
||||
pBufs.commsType() == Pstream::commsTypes::blocking
|
||||
pBufs.commsType() == Pstream::commsTypes::buffered
|
||||
|| pBufs.commsType() == Pstream::commsTypes::nonBlocking
|
||||
)
|
||||
{
|
||||
|
@ -1606,7 +1606,7 @@ void Foam::faMesh::calcPointAreaNormals(vectorField& result) const
|
||||
{
|
||||
UOPstream::write
|
||||
(
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::commsTypes::buffered,
|
||||
procPatch.neighbProcNo(),
|
||||
patchPointNormals
|
||||
);
|
||||
@ -1618,7 +1618,7 @@ void Foam::faMesh::calcPointAreaNormals(vectorField& result) const
|
||||
{
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::commsTypes::blocking,
|
||||
UPstream::commsTypes::buffered,
|
||||
procPatch.neighbProcNo(),
|
||||
patchPointNormals
|
||||
);
|
||||
@ -1916,7 +1916,7 @@ void Foam::faMesh::calcPointAreaNormalsByQuadricsFit(vectorField& result) const
|
||||
{
|
||||
OPstream toNeighbProc
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::commsTypes::buffered,
|
||||
procPatch.neighbProcNo(),
|
||||
toNgbProcLsPoints.size_bytes()
|
||||
+ toNgbProcLsPointStarts.size_bytes()
|
||||
@ -1945,7 +1945,7 @@ void Foam::faMesh::calcPointAreaNormalsByQuadricsFit(vectorField& result) const
|
||||
{
|
||||
IPstream fromNeighbProc
|
||||
(
|
||||
Pstream::commsTypes::blocking,
|
||||
Pstream::commsTypes::buffered,
|
||||
procPatch.neighbProcNo(),
|
||||
10*patchPointLabels.size()*sizeof(vector)
|
||||
+ fromNgbProcLsPointStarts.size_bytes()
|
||||
|
@ -130,7 +130,7 @@ public:
|
||||
// HJ, 30/Jun/2009
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{
|
||||
initEvaluate(commsType);
|
||||
@ -172,7 +172,7 @@ public:
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{
|
||||
evaluate(commsType);
|
||||
|
@ -136,7 +136,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -210,7 +210,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
|
||||
|
@ -231,7 +231,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
|
@ -178,7 +178,7 @@ public:
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -186,7 +186,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -133,7 +133,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
|
@ -92,7 +92,7 @@ Foam::cyclicFaPatchField<Type>::cyclicFaPatchField
|
||||
|
||||
if (IOobjectOption::isReadRequired(requireValue))
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ public:
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -200,7 +200,7 @@ public:
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -124,7 +124,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
|
||||
|
@ -155,7 +155,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
|
@ -564,7 +564,7 @@ public:
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -572,7 +572,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Initialise the evaluation of the patch field after a local
|
||||
@ -580,7 +580,7 @@ public:
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -588,7 +588,7 @@ public:
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -482,7 +482,7 @@ public:
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -490,7 +490,7 @@ public:
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -516,14 +516,14 @@ public:
|
||||
//- Initialise the evaluation of the patch field, generally a no-op
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
//- Evaluate the patch field, generally a no-op
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
@ -188,7 +188,7 @@ public:
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{
|
||||
initEvaluate(commsType);
|
||||
@ -198,7 +198,7 @@ public:
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{
|
||||
evaluate(commsType);
|
||||
|
@ -191,7 +191,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
@ -135,7 +135,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -210,7 +210,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
|
@ -268,7 +268,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
|
@ -176,7 +176,7 @@ public:
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -184,7 +184,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -142,7 +142,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
|
@ -70,7 +70,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
|
||||
|
||||
if (needValue)
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField
|
||||
const int oldConsistency = consistency;
|
||||
consistency = 0;
|
||||
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
|
||||
consistency = oldConsistency;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
|
||||
cyclicAMIFvPatchField<Type>(p, iF, dict)
|
||||
{
|
||||
// Call this evaluation in derived classes
|
||||
//this->evaluate(Pstream::commsTypes::blocking);
|
||||
//this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
|
||||
|
||||
|
@ -199,7 +199,7 @@ public:
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
@ -208,7 +208,7 @@ public:
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -145,7 +145,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
@ -192,7 +192,7 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ public:
|
||||
//- Evaluate the patch field, sets updated() to false
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Write
|
||||
|
@ -251,7 +251,7 @@ public:
|
||||
// to false.
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Write
|
||||
|
@ -89,7 +89,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
this->evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
@ -93,7 +93,7 @@ flowRateInletVelocityFvPatchVectorField
|
||||
// Value field required if mass based
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
evaluate(Pstream::commsTypes::blocking);
|
||||
evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ flowRateOutletVelocityFvPatchVectorField
|
||||
// Value field required if mass based
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
evaluate(Pstream::commsTypes::blocking);
|
||||
evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ public:
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Write
|
||||
|
@ -72,7 +72,7 @@ matchedFlowRateOutletVelocityFvPatchVectorField
|
||||
// Value field required if mass based
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
evaluate(Pstream::commsTypes::blocking);
|
||||
evaluate(Pstream::commsTypes::buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ public:
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::blocking
|
||||
Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user