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,6 +42,20 @@ Foam::DynamicList<MPI_Request> OPstream_outstandingRequests_;
|
||||
|
||||
Foam::OPstream::~OPstream()
|
||||
{
|
||||
if (commsType_ == nonBlocking)
|
||||
{
|
||||
// alloc nonBlocking only if empty buffer. This denotes the buffer
|
||||
// having been transfered out.
|
||||
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
|
||||
@ -54,9 +68,10 @@ Foam::OPstream::~OPstream()
|
||||
)
|
||||
{
|
||||
FatalErrorIn("OPstream::~OPstream()")
|
||||
<< "MPI_Bsend cannot send outgoing message"
|
||||
<< "MPI cannot send outgoing message"
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user