mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
check for non-blocking OPstream usage
This commit is contained in:
@ -42,20 +42,35 @@ Foam::DynamicList<MPI_Request> OPstream_outstandingRequests_;
|
|||||||
|
|
||||||
Foam::OPstream::~OPstream()
|
Foam::OPstream::~OPstream()
|
||||||
{
|
{
|
||||||
if
|
if (commsType_ == nonBlocking)
|
||||||
(
|
|
||||||
!write
|
|
||||||
(
|
|
||||||
commsType_,
|
|
||||||
toProcNo_,
|
|
||||||
buf_.begin(),
|
|
||||||
bufPosition_
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
FatalErrorIn("OPstream::~OPstream()")
|
// alloc nonBlocking only if empty buffer. This denotes the buffer
|
||||||
<< "MPI_Bsend cannot send outgoing message"
|
// having been transfered out.
|
||||||
<< Foam::abort(FatalError);
|
if (bufPosition_ > 0)
|
||||||
|
{
|
||||||
|
FatalErrorIn("OPstream::~OPstream()")
|
||||||
|
<< "OPstream contains buffer so cannot be used with nonBlocking"
|
||||||
|
<< " since destructor would destroy buffer whilst possibly"
|
||||||
|
<< " still sending." << Foam::abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!write
|
||||||
|
(
|
||||||
|
commsType_,
|
||||||
|
toProcNo_,
|
||||||
|
buf_.begin(),
|
||||||
|
bufPosition_
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalErrorIn("OPstream::~OPstream()")
|
||||||
|
<< "MPI cannot send outgoing message"
|
||||||
|
<< Foam::abort(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user