added check for outstanding requests

This commit is contained in:
mattijs 2009-08-28 12:36:32 +01:00
parent b9e8d0fa82
commit 48c77d83a7

View File

@ -131,6 +131,19 @@ void Foam::Pstream::exit(int errnum)
delete[] buff;
# endif
if (PstreamGlobals::outstandingRequests_.size())
{
label n = PstreamGlobals::outstandingRequests_.size();
PstreamGlobals::outstandingRequests_.clear();
WarningIn("Pstream::exit(int)")
<< "There are still " << n << " outstanding MPI_Requests." << endl
<< "This means that your code exited before doing a"
<< " Pstream::waitRequests()." << endl
<< "This should not happen for a normal code exit."
<< endl;
}
if (errnum == 0)
{
MPI_Finalize();